Skip to main content

ReadonlyState

Trait ReadonlyState 

Source
pub trait ReadonlyState: Send + Sync {
    // Required methods
    fn get(&self, key: &str) -> Result<Value, SessionError>;
    fn all(&self) -> Vec<(String, Value)>;
}
Expand description

A read-only view of a key-value store of JSON values.

Required Methods§

Source

fn get(&self, key: &str) -> Result<Value, SessionError>

The value for key; SessionError::StateKeyNotExist if absent.

Source

fn all(&self) -> Vec<(String, Value)>

A snapshot of all key-value pairs; order is not guaranteed.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§