Trait KeyValue

Source
pub trait KeyValue: Send + Sync {
    // Required methods
    fn get(&self, key: Vec<u8>) -> Result<Vec<u8>, Error>;
    fn insert(&self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error>;
}
Expand description

Trivial key/value storage.

Required Methods§

Source

fn get(&self, key: Vec<u8>) -> Result<Vec<u8>, Error>

Fetch the value for a specific key.

Source

fn insert(&self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error>

Store a specific key/value into storage.

Implementations on Foreign Types§

Source§

impl<T: ?Sized + KeyValue> KeyValue for Arc<T>

Source§

fn get(&self, key: Vec<u8>) -> Result<Vec<u8>, Error>

Source§

fn insert(&self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error>

Implementors§