Trait sixarm_collections::hash_map_to_set::HashMapToSetExt[][src]

pub trait HashMapToSetExt<K, V> {
    fn sub_contains(&self, key: &K, value: &V) -> bool
    where
        K: Hash + Eq,
        V: Hash + Eq
;
fn sub_insert(&mut self, key: K, value: V) -> bool
    where
        K: Hash + Eq,
        V: Hash + Eq
;
fn sub_remove(&mut self, key: &K, value: &V) -> bool
    where
        K: Hash + Eq,
        V: Hash + Eq
; }

Required methods

fn sub_contains(&self, key: &K, value: &V) -> bool where
    K: Hash + Eq,
    V: Hash + Eq
[src]

fn sub_insert(&mut self, key: K, value: V) -> bool where
    K: Hash + Eq,
    V: Hash + Eq
[src]

fn sub_remove(&mut self, key: &K, value: &V) -> bool where
    K: Hash + Eq,
    V: Hash + Eq
[src]

Loading content...

Implementors

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]

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]

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]

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);
Loading content...