Skip to main content

Store

Trait Store 

Source
pub trait Store {
    // Required methods
    fn load(&self) -> Option<SessionState>;
    fn save(&self, state: &SessionState) -> Result<()>;
}
Expand description

A place to load and save SessionState. MemStore keeps nothing (a fresh session each run); a file store (native) or a browser store (wasm, localStorage) persists. The caller keys the store by the session’s source identity.

Required Methods§

Source

fn load(&self) -> Option<SessionState>

Source

fn save(&self, state: &SessionState) -> Result<()>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl Store for FileStore

Available on crate feature native only.
Source§

impl Store for MemStore