pub trait Store: Send + Sync {
    type Value;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str
    ) -> Pin<Box<dyn Future<Output = SessionResult<Option<Self::Value>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn set<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        value: Self::Value,
        duration: Duration
    ) -> Pin<Box<dyn Future<Output = SessionResult<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn touch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
        duration: Duration
    ) -> Pin<Box<dyn Future<Output = SessionResult<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
;
fn remove<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str
    ) -> Pin<Box<dyn Future<Output = SessionResult<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }
Expand description

A generic store in which to write and retrive sessions either trough an in memory hashmap or a database connection.

Associated Types

Type that is associated with sessions.

The store will store and retrieve values of this type.

Required methods

Get the value from the store

Set the value from the store

Touch the value, refreshing its expiry time.

Remove the value from the store.

Implementors