Skip to main content

ReadonlyState

Trait ReadonlyState 

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

Read-only view of session state.

Required Methods§

Source

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

Returns the value for the given key, or None if not present.

Source

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

Returns all key-value pairs in the state.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§