Trait tower_sessions::SessionStore
source · 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§
Required Methods§
sourcefn 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 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.
Object Safety§
This trait is not object safe.
Implementors§
source§impl SessionStore for MemoryStore
Available on crate feature memory-store only.
impl SessionStore for MemoryStore
Available on crate feature
memory-store only.type Error = Infallible
source§impl SessionStore for MokaStore
Available on crate feature moka-store only.
impl SessionStore for MokaStore
Available on crate feature
moka-store only.type Error = Infallible
source§impl SessionStore for MongoDBStore
Available on crate feature mongodb-store only.
impl SessionStore for MongoDBStore
Available on crate feature
mongodb-store only.source§impl SessionStore for MySqlStore
Available on crate features mysql-store and sqlx-store only.
impl SessionStore for MySqlStore
Available on crate features
mysql-store and sqlx-store only.type Error = SqlxStoreError
source§impl SessionStore for PostgresStore
Available on crate features postgres-store and sqlx-store only.
impl SessionStore for PostgresStore
Available on crate features
postgres-store and sqlx-store only.type Error = SqlxStoreError
source§impl SessionStore for RedisStore
Available on crate feature redis-store only.
impl SessionStore for RedisStore
Available on crate feature
redis-store only.source§impl SessionStore for SqliteStore
Available on crate features sqlite-store and sqlx-store only.
impl SessionStore for SqliteStore
Available on crate features
sqlite-store and sqlx-store only.