ReadableHashMapExt

Trait ReadableHashMapExt 

Source
pub trait ReadableHashMapExt<K, V, H>: Readable<Target = HashMap<K, V, H>>
where K: 'static, V: 'static, H: 'static,
{ // Provided methods fn is_empty(&self) -> bool { ... } fn len(&self) -> usize { ... } fn capacity(&self) -> usize { ... } fn get(&self, key: &K) -> Option<<Self::Storage as AnyStorage>::Ref<'_, V>> where K: Hash + Eq, H: BuildHasher { ... } fn contains_key(&self, key: &K) -> bool where K: Hash + Eq, H: BuildHasher { ... } }
Available on crate feature prelude only.
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<<Self::Storage as AnyStorage>::Ref<'_, 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, V, H, R> ReadableHashMapExt<K, V, H> for R
where K: 'static, V: 'static, H: 'static, R: Readable<Target = HashMap<K, V, H>>,