Skip to main content

SessionStorage

Trait SessionStorage 

Source
pub trait SessionStorage: Send + Sync {
    // Required methods
    fn start_session(&self, username: String) -> Result<String, Error>;
    fn end_session(
        &self,
        username: String,
        session_id: EncryptionContext,
    ) -> Result<(), Error>;
    fn get_sessions_for_user(
        &self,
        username: String,
    ) -> Result<Vec<EncryptionContext>, Error>;
    fn get_all_sessions(&self) -> Result<Vec<EncryptionContext>, Error>;
    fn session_exists(
        &self,
        username: String,
        session_id: EncryptionContext,
    ) -> Result<bool, Error>;
    fn clone_box(&self) -> Box<dyn SessionStorage>;
}

Required Methods§

Trait Implementations§

Source§

impl Clone for Box<dyn SessionStorage>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§