pub trait SessionStore: Clone + Send + Sync + 'static {
    type Error: Error + Send + Sync;

    // Required methods
    fn save<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_record: &'life1 SessionRecord
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn load<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: &'life1 SessionId
    ) -> Pin<Box<dyn Future<Output = Result<Option<Session>, Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session_id: &'life1 SessionId
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

An arbitrary store which houses the session data.

Required Associated Types§

source

type Error: Error + Send + Sync

An error that occurs when interacting with the store.

Required Methods§

source

fn save<'life0, 'life1, 'async_trait>( &'life0 self, session_record: &'life1 SessionRecord ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

A method for saving a session in a store.

source

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

A method for loading a session from a store.

source

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

A method for deleting a session from a store.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl SessionStore for MemoryStore

Available on crate feature memory-store only.
source§

impl SessionStore for MokaStore

Available on crate feature moka-store only.
source§

impl SessionStore for MongoDBStore

Available on crate feature mongodb-store only.
§

type Error = MongoDBStoreError

source§

impl SessionStore for MySqlStore

Available on crate features mysql-store and sqlx-store only.
source§

impl SessionStore for PostgresStore

Available on crate features postgres-store and sqlx-store only.
source§

impl SessionStore for RedisStore

Available on crate feature redis-store only.
§

type Error = RedisStoreError

source§

impl SessionStore for SqliteStore

Available on crate features sqlite-store and sqlx-store only.
source§

impl<Cache, Store> SessionStore for CachingSessionStore<Cache, Store>where Cache: SessionStore, Store: SessionStore,

§

type Error = CachingStoreError<Cache, Store>