Trait ITokenManager

Source
pub trait ITokenManager<T>: Send + Sync {
    // Required methods
    fn get_token<'life0, 'async_trait>(
        &'life0 self,
        session_id: i64,
    ) -> Pin<Box<dyn Future<Output = Option<NetxToken<T>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_all_tokens<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<NetxToken<T>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for managing tokens.

Required Methods§

Source

fn get_token<'life0, 'async_trait>( &'life0 self, session_id: i64, ) -> Pin<Box<dyn Future<Output = Option<NetxToken<T>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves a token by its session ID.

§Arguments
  • session_id - The session ID of the token.
§Returns

An Option containing the NetxToken if found.

Source

fn get_all_tokens<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<NetxToken<T>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves all tokens.

§Returns

A Result containing a Vec of all NetxTokens or an error.

Implementors§