Trait MapUtils

Source
pub trait MapUtils<K, V> {
    // Required methods
    fn get_or<'a>(&'a self, key: &K, fallback: &'a V) -> &'a V;
    fn insert_if(&mut self, key: K, value: V, cond: bool);
}

Required Methods§

Source

fn get_or<'a>(&'a self, key: &K, fallback: &'a V) -> &'a V

Source

fn insert_if(&mut self, key: K, value: V, cond: bool)

Implementations on Foreign Types§

Source§

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

Source§

fn get_or<'a>(&'a self, key: &K, fallback: &'a V) -> &'a V

Source§

fn insert_if(&mut self, key: K, value: V, cond: bool)

Implementors§