Skip to main content

TokenSourceConfigurable

Trait TokenSourceConfigurable 

Source
pub trait TokenSourceConfigurable {
    // Required method
    fn fetch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        options: &'life1 TokenSourceFetchOptions,
    ) -> Pin<Box<dyn Future<Output = TokenSourceResult<TokenSourceResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn cached(self) -> TokenSourceCached<Self>
       where Self: Sized + Send + Sync { ... }
}
Expand description

A token source that generates credentials from per-call TokenSourceFetchOptions (room name, participant identity, agent dispatch, …).

Implement this trait to plug a custom credential backend into code that is generic over token sources.

Required Methods§

Source

fn fetch<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 TokenSourceFetchOptions, ) -> Pin<Box<dyn Future<Output = TokenSourceResult<TokenSourceResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn cached(self) -> TokenSourceCached<Self>
where Self: Sized + Send + Sync,

Wraps this source in a caching layer that stores the last fetched credentials and serves them for repeat fetches with equal options, for as long as the token stays valid. See TokenSourceCached.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§