NestedHashMapExtensions

Trait NestedHashMapExtensions 

Source
pub trait NestedHashMapExtensions<K, K2, V> {
    // Required method
    fn insert_into_nested(
        &mut self,
        outer_key: K,
        inner_key: K2,
        inner_value: V,
    );
}

Required Methods§

Source

fn insert_into_nested(&mut self, outer_key: K, inner_key: K2, inner_value: V)

For use with a hashmap within a hashmap, takes an outer and inner key, and an inner value

  1. if the outer key exists with and inner hashmap the key-value pair is inserted to the existing hashmap.
  2. a new inner hashmap is created with the key-value pair if the outer key does not exist.

Implementations on Foreign Types§

Source§

impl<K, K2, V> NestedHashMapExtensions<K, K2, V> for HashMap<K, HashMap<K2, V>>
where K: Hash + PartialEq + Eq, K2: Hash + PartialEq + Eq,

Source§

fn insert_into_nested(&mut self, outer_key: K, inner_key: K2, inner_value: V)

Implementors§