Skip to main content

TokenStorage

Trait TokenStorage 

Source
pub trait TokenStorage: Send + Sync {
    // Required methods
    fn store(
        &self,
        token: &TokenInfo,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>;
    fn load(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<TokenInfo>> + Send + '_>>;
    fn delete(&self) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>;
}
Expand description

Trait for persistent token storage.

All methods are async so implementations can perform I/O (file, database, remote store) without blocking the Tokio executor.

Required Methods§

Source

fn store( &self, token: &TokenInfo, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>

Store a token.

Source

fn load(&self) -> Pin<Box<dyn Future<Output = Result<TokenInfo>> + Send + '_>>

Load the stored token.

Source

fn delete(&self) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>

Delete the stored token.

Implementors§