Skip to main content

SessionStore

Trait SessionStore 

Source
pub trait SessionStore:
    Send
    + Sync
    + 'static {
    // Required methods
    fn load(&self, id: &str) -> BoxFuture<'_, Result<Option<SessionData>>>;
    fn save(
        &self,
        id: &str,
        data: SessionData,
        ttl: Duration,
    ) -> BoxFuture<'_, Result<()>>;
    fn destroy(&self, id: &str) -> BoxFuture<'_, Result<()>>;
}
Expand description

Where session data lives.

Required Methods§

Source

fn load(&self, id: &str) -> BoxFuture<'_, Result<Option<SessionData>>>

Source

fn save( &self, id: &str, data: SessionData, ttl: Duration, ) -> BoxFuture<'_, Result<()>>

Source

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§