Skip to main content

State

Trait State 

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

Required Methods§

Source

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

Source

fn set(&mut self, key: String, value: Value)

Set a state value. Implementations should call validate_state_key and reject invalid keys (e.g., by logging a warning or panicking).

Source

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

Implementors§