Storage

Trait Storage 

Source
pub trait Storage: Send + Sync {
    // Required methods
    fn save(&self, key: &str, data: &[u8]);
    fn load(&self, key: &str) -> Option<Vec<u8>>;
    fn remove(&self, key: &str);
    fn contains(&self, key: &str) -> bool;
}
Expand description

Storage trait for state persistence commands.

Required Methods§

Source

fn save(&self, key: &str, data: &[u8])

Save data to storage.

Source

fn load(&self, key: &str) -> Option<Vec<u8>>

Load data from storage.

Source

fn remove(&self, key: &str)

Remove data from storage.

Source

fn contains(&self, key: &str) -> bool

Check if a key exists.

Implementors§