Skip to main content

SessionStore

Trait SessionStore 

Source
pub trait SessionStore:
    Send
    + Sync
    + 'static {
    // Required methods
    fn load<'a>(
        &'a self,
        id: &'a str,
    ) -> BoxFuture<'a, Option<HashMap<String, String>>>;
    fn save<'a>(
        &'a self,
        id: &'a str,
        data: &'a HashMap<String, String>,
        ttl: Duration,
    ) -> BoxFuture<'a, ()>;
    fn destroy<'a>(&'a self, id: &'a str) -> BoxFuture<'a, ()>;
    fn destroy_user<'a>(
        &'a self,
        user_id: &'a str,
        keep_sid: Option<&'a str>,
    ) -> BoxFuture<'a, u64>;
}
Expand description

Backend for cookie sessions (load/save/destroy + logout-by-user).

Required Methods§

Source

fn load<'a>( &'a self, id: &'a str, ) -> BoxFuture<'a, Option<HashMap<String, String>>>

Source

fn save<'a>( &'a self, id: &'a str, data: &'a HashMap<String, String>, ttl: Duration, ) -> BoxFuture<'a, ()>

Source

fn destroy<'a>(&'a self, id: &'a str) -> BoxFuture<'a, ()>

Source

fn destroy_user<'a>( &'a self, user_id: &'a str, keep_sid: Option<&'a str>, ) -> BoxFuture<'a, u64>

Remove all sessions for user_id. If keep_sid is set, leave that id.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§