[][src]Trait twitch_irc::login::TokenStorage

pub trait TokenStorage: Debug + Send + 'static {
    type LoadError: Send + Sync + Debug + Display;
    type UpdateError: Send + Sync + Debug + Display;
#[must_use]    fn load_token<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Result<UserAccessToken, Self::LoadError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn update_token<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        token: &'life1 UserAccessToken
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::UpdateError>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }

Load and store the currently valid version of the user's OAuth Access Token.

Associated Types

type LoadError: Send + Sync + Debug + Display

Possible error type when trying to load the token from this storage.

type UpdateError: Send + Sync + Debug + Display

Possible error type when trying to update the token in this storage.

Loading content...

Required methods

#[must_use]fn load_token<'life0, 'async_trait>(
    &'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<UserAccessToken, Self::LoadError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 

Load the currently stored token from the storage.

#[must_use]fn update_token<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    token: &'life1 UserAccessToken
) -> Pin<Box<dyn Future<Output = Result<(), Self::UpdateError>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 

Called after the token was updated successfully, to save the new token. After update_token() completes, the load_token() method should then return that token for future invocations

Loading content...

Implementors

Loading content...