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§
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§
Sourcefn cached(self) -> TokenSourceCached<Self>
fn cached(self) -> TokenSourceCached<Self>
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".