RawStore

Trait RawStore 

Source
pub trait RawStore<K, V> {
    // Required method
    fn get(&self, key: &K) -> Option<&V>;

    // Provided method
    fn contains_key(&self, key: &K) -> bool { ... }
}
Expand description

The RawStore trait is used to define an interface for key-value stores like hash-maps, dictionaries, and similar data structures.

Required Methods§

Source

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

retrieves a reference to a value by key

Provided Methods§

Source

fn contains_key(&self, key: &K) -> bool

returns true if the key is associated with a value in the store

Implementations on Foreign Types§

Source§

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

Source§

fn contains_key(&self, key: &K) -> bool

Source§

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

Source§

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

Source§

fn contains_key(&self, key: &K) -> bool

Source§

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

Implementors§