ReadableHashMapExt

Trait ReadableHashMapExt 

Source
pub trait ReadableHashMapExt<K: 'static, V: 'static, H: 'static>: Readable<Target = HashMap<K, V, H>> {
    // Provided methods
    fn is_empty(&self) -> bool { ... }
    fn len(&self) -> usize { ... }
    fn capacity(&self) -> usize { ... }
    fn get(&self, key: &K) -> Option<ReadableRef<'_, Self, V>>
       where K: Hash + Eq,
             H: BuildHasher { ... }
    fn contains_key(&self, key: &K) -> bool
       where K: Hash + Eq,
             H: BuildHasher { ... }
}
Expand description

An extension trait for Readable<HashMap<K, V, H>> that provides some convenience methods.

Provided Methods§

Source

fn is_empty(&self) -> bool

Check if the hashmap is empty.

Source

fn len(&self) -> usize

Get the length of the hashmap.

Source

fn capacity(&self) -> usize

Get the capacity of the hashmap.

Source

fn get(&self, key: &K) -> Option<ReadableRef<'_, Self, V>>
where K: Hash + Eq, H: BuildHasher,

Get the value for the given key.

Source

fn contains_key(&self, key: &K) -> bool
where K: Hash + Eq, H: BuildHasher,

Check if the hashmap contains the given key.

Implementors§

Source§

impl<K: 'static, V: 'static, H: 'static, R> ReadableHashMapExt<K, V, H> for R
where R: Readable<Target = HashMap<K, V, H>>,