pub trait SessionStorage: Send + Sync {
    // Required methods
    fn load_session<'a>(
        &'a self,
        session_id: &'a str
    ) -> impl Future<Output = Result<Option<BTreeMap<String, Value>>>> + Send + 'a;
    fn update_session<'a>(
        &'a self,
        session_id: &'a str,
        entries: &'a BTreeMap<String, Value>,
        expires: Option<Duration>
    ) -> impl Future<Output = Result<()>> + Send + 'a;
    fn remove_session<'a>(
        &'a self,
        session_id: &'a str
    ) -> impl Future<Output = Result<()>> + Send + 'a;
}
Available on crate feature session only.
Expand description

Represents a back-end session storage.

Required Methods§

source

fn load_session<'a>( &'a self, session_id: &'a str ) -> impl Future<Output = Result<Option<BTreeMap<String, Value>>>> + Send + 'a

Load session entries.

source

fn update_session<'a>( &'a self, session_id: &'a str, entries: &'a BTreeMap<String, Value>, expires: Option<Duration> ) -> impl Future<Output = Result<()>> + Send + 'a

Insert or update a session.

source

fn remove_session<'a>( &'a self, session_id: &'a str ) -> impl Future<Output = Result<()>> + Send + 'a

Remove a session by session id.

Object Safety§

This trait is not object safe.

Implementors§