Skip to main content

SessionStore

Trait SessionStore 

Source
pub trait SessionStore: Send + Sync {
    // Required methods
    fn load(&self) -> Result<Option<Session>, StoreError>;
    fn save(&self, session: &Session) -> Result<(), StoreError>;
    fn delete(&self) -> Result<(), StoreError>;
}
Expand description

Where the session lives between runs. Implementations block briefly (keyring call, small file), so they are synchronous.

Required Methods§

Source

fn load(&self) -> Result<Option<Session>, StoreError>

The stored session, or None when not logged in (missing, unreadable or unknown-version data).

Source

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

Replaces the stored session.

Source

fn delete(&self) -> Result<(), StoreError>

Removes the stored session; succeeds when there is none.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§