Trait fred::types::CredentialProvider

source ·
pub trait CredentialProvider: Debug + 'static {
    // Required method
    fn fetch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        server: Option<&'life1 Server>,
    ) -> Pin<Box<dyn Future<Output = Result<(Option<String>, Option<String>), RedisError>> + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn refresh_interval(&self) -> Option<Duration> { ... }
}
Available on crate feature credential-provider only.
Expand description

A trait that can be used to override the credentials used in each AUTH or HELLO command.

Required Methods§

source

fn fetch<'life0, 'life1, 'async_trait>( &'life0 self, server: Option<&'life1 Server>, ) -> Pin<Box<dyn Future<Output = Result<(Option<String>, Option<String>), RedisError>> + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Read the username and password that should be used in the next AUTH or HELLO command.

Provided Methods§

source

fn refresh_interval(&self) -> Option<Duration>

Configure the client to call fetch and send AUTH or HELLO on some interval.

Implementors§