Type Definition sixarm_collections::hash_map_to_set::HashMapToSet [−][src]
type HashMapToSet<K, V> = HashMap<K, HashSet<V>>;
Trait Implementations
impl<K, V> HashMapToSetExt<K, V> for HashMapToSet<K, V>
[src]
fn sub_contains(&self, key: &K, value: &V) -> bool where
K: Hash + Eq,
V: Hash + Eq,
[src]
K: Hash + Eq,
V: Hash + Eq,
Return true
if the collection contains a sub-key-value item.
The value may be any borrowed form of the set’s value type, but
Hash
and Eq
on the borrowed form must match those for
the value type.
Examples
use sixarm_collections::*; let mut a: HashMapToSet<u8, u8> = HashMapToSet::new(); a.sub_insert(1, 2); assert_eq!(a.sub_contains(&1, &2), true); assert_eq!(a.sub_contains(&3, &4), false);
fn sub_insert(&mut self, key: K, value: V) -> bool where
K: Hash + Eq,
V: Hash + Eq,
[src]
K: Hash + Eq,
V: Hash + Eq,
Add a sub-key-value item to the collection.
Return whether the item is added in the set.
Examples
use sixarm_collections::*; let mut a: HashMapToSet<u8, u8> = HashMapToSet::new(); a.sub_insert(1, 2); assert_eq!(a.sub_contains(&1, &2), true);
fn sub_remove(&mut self, key: &K, value: &V) -> bool where
K: Hash + Eq,
V: Hash + Eq,
[src]
K: Hash + Eq,
V: Hash + Eq,
Remove a sub-key-value pair from the collection.
Return whether the value was present in the set.
The value may be any borrowed form of the set’s value type, but
Hash
and Eq
on the borrowed form must match those for
the value type.
Examples
use sixarm_collections::*; let mut a: HashMapToSet<u8, u8> = HashMapToSet::new(); a.sub_insert(1, 2); assert_eq!(a.sub_contains(&1, &2), true); a.sub_remove(&1, &2); assert_eq!(a.sub_contains(&1, &2), false);