pub trait SessionStore:
Send
+ Sync
+ 'static {
// Required methods
fn get(&self, key: &SessionKey) -> GResult<Option<(Session, Cas)>>;
fn put(&self, session: Session) -> GResult<Cas>;
fn update_cas(
&self,
session: Session,
expected: Cas,
) -> GResult<Result<Cas, Cas>>;
fn delete(&self, key: &SessionKey) -> GResult<bool>;
fn touch(&self, key: &SessionKey, ttl_secs: Option<u32>) -> GResult<bool>;
}Required Methods§
Sourcefn get(&self, key: &SessionKey) -> GResult<Option<(Session, Cas)>>
fn get(&self, key: &SessionKey) -> GResult<Option<(Session, Cas)>>
Fetch by key; returns (Session, Cas) if present.
Sourcefn update_cas(
&self,
session: Session,
expected: Cas,
) -> GResult<Result<Cas, Cas>>
fn update_cas( &self, session: Session, expected: Cas, ) -> GResult<Result<Cas, Cas>>
Update using CAS—only writes if expected matches the stored Cas.
Sourcefn delete(&self, key: &SessionKey) -> GResult<bool>
fn delete(&self, key: &SessionKey) -> GResult<bool>
Delete by key; return true if something was deleted.