Credentials

Trait Credentials 

pub trait Credentials:
    Send
    + Sync
    + 'static {
    type Token;

    // Required methods
    fn get_token<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Token, GetTokenError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn clear_token<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), ClearTokenError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn valid<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}

Required Associated Types§

type Token

Required Methods§

fn get_token<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::Token, GetTokenError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

fn clear_token<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), ClearTokenError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

fn valid<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if the token is valid. The default implementation checks if the token can be acquired via Credentials::get_token.

Implementations on Foreign Types§

§

impl<C: Credentials> Credentials for Arc<C>

Implement Credentials for Arc<Credentials>

§

type Token = <C as Credentials>::Token

§

fn get_token<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Self::Token, GetTokenError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

§

fn clear_token<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), ClearTokenError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§