pub trait TokenSourceStore: Send + Sync {
// Required methods
fn store<'life0, 'async_trait>(
&'life0 self,
options: TokenSourceFetchOptions,
response: TokenSourceResponse,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn retrieve<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<(TokenSourceFetchOptions, TokenSourceResponse)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn clear<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Persistence backend for TokenSourceCached.
Implement this trait to keep credentials in a custom location, e.g. the
platform keychain or a database. The default is the process-lifetime
TokenSourceInMemoryStore.
Required Methods§
Sourcefn store<'life0, 'async_trait>(
&'life0 self,
options: TokenSourceFetchOptions,
response: TokenSourceResponse,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store<'life0, 'async_trait>(
&'life0 self,
options: TokenSourceFetchOptions,
response: TokenSourceResponse,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stores the given credentials, replacing any stored previously.
Sourcefn retrieve<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<(TokenSourceFetchOptions, TokenSourceResponse)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn retrieve<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<(TokenSourceFetchOptions, TokenSourceResponse)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the stored credentials, or None if nothing is stored.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".