Trait scsys_core::stores::kv::Store

source ·
pub trait Store<K, V> {
    // Required methods
    fn get(&self, key: &K) -> Option<&V>;
    fn get_mut(&mut self, key: &K) -> Option<&mut V>;
    fn insert(&mut self, key: K, value: V) -> Option<V>;
    fn remove(&mut self, key: &K) -> Option<V>;
}

Required Methods§

source

fn get(&self, key: &K) -> Option<&V>

source

fn get_mut(&mut self, key: &K) -> Option<&mut V>

source

fn insert(&mut self, key: K, value: V) -> Option<V>

source

fn remove(&mut self, key: &K) -> Option<V>

Implementations on Foreign Types§

source§

impl<K, V> Store<K, V> for BTreeMap<K, V>
where K: Ord,

source§

fn get(&self, key: &K) -> Option<&V>

source§

fn get_mut(&mut self, key: &K) -> Option<&mut V>

source§

fn insert(&mut self, key: K, value: V) -> Option<V>

source§

fn remove(&mut self, key: &K) -> Option<V>

source§

impl<K, V> Store<K, V> for HashMap<K, V>
where K: Eq + Hash,

source§

fn get(&self, key: &K) -> Option<&V>

source§

fn get_mut(&mut self, key: &K) -> Option<&mut V>

source§

fn insert(&mut self, key: K, value: V) -> Option<V>

source§

fn remove(&mut self, key: &K) -> Option<V>

Implementors§