Struct typedb::KV
[−]
[src]
pub struct KV<K, V> { /* fields omitted */ }
The type that represents the key-value store
Methods
impl<K, V> KV<K, V> where
K: Clone + Serialize + for<'kde> Deserialize<'kde> + Eq + Hash,
V: Clone + Serialize + for<'vde> Deserialize<'vde>,
[src]
K: Clone + Serialize + for<'kde> Deserialize<'kde> + Eq + Hash,
V: Clone + Serialize + for<'vde> Deserialize<'vde>,
fn new(p: &'static str) -> Result<KV<K, V>, KVError>
Creates a new instance of the KV store
fn insert(&mut self, key: K, value: V) -> Result<bool, KVError>
Inserta a key, value pair into the key-value store
fn get(&mut self, key: K) -> Result<Option<V>, KVError>
Get the value from a key
fn remove(&mut self, key: K) -> Result<bool, KVError>
Removes a key and associated value from the key-value Store
fn keys(&mut self) -> Result<Vec<K>, KVError>
get all the keys contained in the KV Store