Skip to main content

TokenProvider

Trait TokenProvider 

Source
pub trait TokenProvider:
    Send
    + Sync
    + Debug {
    // Required method
    fn token<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<AuthToken, SdkError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Produces the credential header for every outgoing SDK request.

Required Methods§

Source

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

Return the credentials to attach to the next request. May be called on the hot path, so implementations should cache aggressively.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§