pub trait State: Send + Sync {
// Required methods
fn get(&self, key: &str) -> Result<Value, SessionError>;
fn set(&self, key: &str, value: Value) -> Result<(), SessionError>;
fn all(&self) -> Vec<(String, Value)>;
}Expand description
A key-value store of JSON values: read, write and list the state of a session.
Required Methods§
Sourcefn get(&self, key: &str) -> Result<Value, SessionError>
fn get(&self, key: &str) -> Result<Value, SessionError>
The value for key; SessionError::StateKeyNotExist if absent.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".