Skip to main content

SessionStore

Trait SessionStore 

Source
pub trait SessionStore: Send + Sync {
    // Required method
    fn get_session<'life0, 'async_trait>(
        &'life0 self,
        session_id: SessionId,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Session>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for retrieving session configurations

Implementations can:

  • Load sessions from a database
  • Keep sessions in memory for testing

Required Methods§

Source

fn get_session<'life0, 'async_trait>( &'life0 self, session_id: SessionId, ) -> Pin<Box<dyn Future<Output = Result<Option<Session>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a session by ID

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: SessionStore + ?Sized> SessionStore for Arc<T>

Source§

fn get_session<'life0, 'async_trait>( &'life0 self, session_id: SessionId, ) -> Pin<Box<dyn Future<Output = Result<Option<Session>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§