aztec-nr - std::collections::umap

Struct UHashMap

pub struct UHashMap<K, V, B>
{ /* private fields */ }

Implementations

impl<B, K, V> UHashMap<K, V, B>

pub fn with_hasher(_build_hasher: B) -> Self
where B: BuildHasher

Creates a new instance of UHashMap with specified BuildHasher.

pub fn with_hasher_and_capacity(_build_hasher: B, capacity: u32) -> Self
where B: BuildHasher
pub fn clear(&mut self)

Clears the map, removing all key-value entries.

pub fn contains_key(&mut self: &Self, key: K) -> bool
where K: Hash, K: Eq, B: BuildHasher

Returns true if the map contains a value for the specified key.

pub fn is_empty(&mut self: &Self) -> bool

Returns true if the map contains no elements.

pub fn entries(&mut self: &Self) -> [(K, V)]

Returns a vector of all valid entries in this UHashMap. The length of the returned vector will always match the length of this UHashMap.

pub fn keys(&mut self: &Self) -> [K]

Returns a vector containing all the keys within this UHashMap. The length of the returned vector will always match the length of this UHashMap.

pub fn values(&mut self: &Self) -> [V]

Returns a vector containing all the values within this UHashMap. The length of the returned vector will always match the length of this UHashMap.

pub unconstrained fn iter_mut(&mut self, f: fn(K, V) -> (K, V))
where K: Eq, K: Hash, B: BuildHasher

For each key-value entry applies mutator function.

pub unconstrained fn iter_keys_mut(&mut self, f: fn(K) -> K)
where K: Eq, K: Hash, B: BuildHasher

For each key applies mutator function.

pub fn iter_values_mut(&mut self, f: fn(V) -> V)

For each value applies mutator function.

pub fn retain(&mut self, f: fn(K, V) -> bool)

Retains only the elements specified by the predicate.

pub fn len(&mut self: &Self) -> u32

Amount of active key-value entries.

pub fn capacity(&mut self: &Self) -> u32

Get the current capacity of the inner table.

pub unconstrained fn get(&mut self: &Self, key: K) -> Option<V>
where K: Eq, K: Hash, B: BuildHasher

Get the value by key. If it does not exist, returns none().

pub unconstrained fn insert(&mut self, key: K, value: V)
where K: Eq, K: Hash, B: BuildHasher

Insert key-value entry. In case key was already present, value is overridden.

pub unconstrained fn remove(&mut self, key: K)
where K: Eq, K: Hash, B: BuildHasher

Removes a key-value entry. If key is not present, UHashMap remains unchanged.

Trait implementations

impl<B, K, V> Default for UHashMap<K, V, B>
where B: BuildHasher, B: Default

pub fn default() -> Self

impl<B, K, V> Eq for UHashMap<K, V, B>
where K: Eq, K: Hash, V: Eq, B: BuildHasher

pub fn eq(self, other: Self) -> bool