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§
Sourcefn store(
&self,
token: &TokenInfo,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>
fn store( &self, token: &TokenInfo, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + '_>>
Store a token.