Trait fred::interfaces::AuthInterface

source ·
pub trait AuthInterface: ClientLike {
    // Provided methods
    fn auth<S>(
        &self,
        username: Option<String>,
        password: S,
    ) -> impl Future<Output = RedisResult<()>>
       where S: Into<Str> { ... }
    fn hello(
        &self,
        version: RespVersion,
        auth: Option<(Str, Str)>,
        setname: Option<Str>,
    ) -> impl Future<Output = RedisResult<()>> { ... }
}
Expand description

Functions for authenticating clients.

Provided Methods§

source

fn auth<S>( &self, username: Option<String>, password: S, ) -> impl Future<Output = RedisResult<()>>
where S: Into<Str>,

Request for authentication in a password-protected Redis server. Returns ok if successful.

The client will automatically authenticate with the default user if a password is provided in the associated RedisConfig when calling connect.

If running against clustered servers this function will authenticate all connections.

https://redis.io/commands/auth

source

fn hello( &self, version: RespVersion, auth: Option<(Str, Str)>, setname: Option<Str>, ) -> impl Future<Output = RedisResult<()>>

Switch to a different protocol, optionally authenticating in the process.

If running against clustered servers this function will issue the HELLO command to each server concurrently.

https://redis.io/commands/hello

Object Safety§

This trait is not object safe.

Implementors§

source§

impl AuthInterface for RedisClient

source§

impl AuthInterface for SentinelClient

source§

impl AuthInterface for SubscriberClient

source§

impl AuthInterface for Transaction

source§

impl<C: AuthInterface> AuthInterface for Pipeline<C>

Available on crate feature i-server only.
source§

impl<C: AuthInterface> AuthInterface for WithOptions<C>

Available on crate feature i-server only.