Skip to main content

CredentialProvider

Trait CredentialProvider 

Source
pub trait CredentialProvider:
    Debug
    + Send
    + Sync
    + '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>), Error>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;

    // Provided method
    fn refresh_interval(&self) -> Option<Duration> { ... }
}
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>), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: '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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§