SessionCache

Trait SessionCache 

Source
pub trait SessionCache: Debug {
    // Required methods
    fn try_load(&self, session_id: &str) -> Result<Option<Session>, CacheError>;
    fn save(&self, session: &Session) -> Result<(), CacheError>;

    // Provided method
    fn load(&self, session_id: &str) -> Result<Session, CacheError> { ... }
}
Expand description

Stores cached data specific to a session, such as submission timeouts.

Required Methods§

Source

fn try_load(&self, session_id: &str) -> Result<Option<Session>, CacheError>

Load session data linked to a session from the cache. Returns Ok(None) if there is no existing cached session linked to session_id.

Source

fn save(&self, session: &Session) -> Result<(), CacheError>

Writes session data to the cache.

Provided Methods§

Source

fn load(&self, session_id: &str) -> Result<Session, CacheError>

Load session data linked to a session from the cache.

Implementors§