pub trait TokenStorage: Send + Sync {
    fn set<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        scopes: &'life1 [&'life2 str],
        token: TokenInfo
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; fn get<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        scopes: &'life1 [&'life2 str]
    ) -> Pin<Box<dyn Future<Output = Option<TokenInfo>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; }
Expand description

Implement your own token storage solution by implementing this trait. You need a way to store and retrieve tokens, each keyed by a set of scopes.

Required Methods

Store a token for the given set of scopes so that it can be retrieved later by get() TokenInfo can be serialized with serde.

Retrieve a token stored by set for the given set of scopes

Implementors