Skip to main content

SessionStore

Trait SessionStore 

Source
pub trait SessionStore: Send + Sync {
    // Required methods
    fn create_session<'life0, 'async_trait>(
        &'life0 self,
        session: NewSession,
    ) -> Pin<Box<dyn Future<Output = Result<Session, AuthError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn find_by_token_hash<'life0, 'life1, 'async_trait>(
        &'life0 self,
        token_hash: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Session>, AuthError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn find_by_user_id<'life0, 'async_trait>(
        &'life0 self,
        user_id: i64,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Session>, AuthError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn delete_session<'life0, 'async_trait>(
        &'life0 self,
        id: i64,
    ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn delete_by_user_id<'life0, 'async_trait>(
        &'life0 self,
        user_id: i64,
    ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn delete_expired<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<u64, AuthError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Storage backend for session records.

Required Methods§

Source

fn create_session<'life0, 'async_trait>( &'life0 self, session: NewSession, ) -> Pin<Box<dyn Future<Output = Result<Session, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn find_by_token_hash<'life0, 'life1, 'async_trait>( &'life0 self, token_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Session>, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Source

fn find_by_user_id<'life0, 'async_trait>( &'life0 self, user_id: i64, ) -> Pin<Box<dyn Future<Output = Result<Vec<Session>, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn delete_session<'life0, 'async_trait>( &'life0 self, id: i64, ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn delete_by_user_id<'life0, 'async_trait>( &'life0 self, user_id: i64, ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Source

fn delete_expired<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Implementations on Foreign Types§

Source§

impl SessionStore for AuthDb

Source§

fn create_session<'life0, 'async_trait>( &'life0 self, session: NewSession, ) -> Pin<Box<dyn Future<Output = Result<Session, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, AuthDb: 'async_trait,

Source§

fn find_by_token_hash<'life0, 'life1, 'async_trait>( &'life0 self, token_hash: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Session>, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, AuthDb: 'async_trait,

Source§

fn find_by_user_id<'life0, 'async_trait>( &'life0 self, user_id: i64, ) -> Pin<Box<dyn Future<Output = Result<Vec<Session>, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, AuthDb: 'async_trait,

Source§

fn delete_session<'life0, 'async_trait>( &'life0 self, id: i64, ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, AuthDb: 'async_trait,

Source§

fn delete_by_user_id<'life0, 'async_trait>( &'life0 self, user_id: i64, ) -> Pin<Box<dyn Future<Output = Result<(), AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, AuthDb: 'async_trait,

Source§

fn delete_expired<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<u64, AuthError>> + Send + 'async_trait>>
where 'life0: 'async_trait, AuthDb: 'async_trait,

Implementors§