Struct dashmap::ReadOnlyView
source · pub struct ReadOnlyView<K, V, S = RandomState> { /* private fields */ }
Expand description
A read-only view into a DashMap
. Allows to obtain raw references to the stored values.
Implementations§
source§impl<K, V, S> ReadOnlyView<K, V, S>
impl<K, V, S> ReadOnlyView<K, V, S>
sourcepub fn into_inner(self) -> DashMap<K, V, S>
pub fn into_inner(self) -> DashMap<K, V, S>
Consumes this ReadOnlyView
, returning the underlying DashMap
.
source§impl<'a, K: 'a + Eq + Hash, V: 'a, S: BuildHasher + Clone> ReadOnlyView<K, V, S>
impl<'a, K: 'a + Eq + Hash, V: 'a, S: BuildHasher + Clone> ReadOnlyView<K, V, S>
sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the number of elements the map can hold without reallocating.
sourcepub fn contains_key<Q>(&'a self, key: &Q) -> boolwhere
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn contains_key<Q>(&'a self, key: &Q) -> boolwhere
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
Returns true
if the map contains a value for the specified key.
sourcepub fn get<Q>(&'a self, key: &Q) -> Option<&'a V>where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn get<Q>(&'a self, key: &Q) -> Option<&'a V>where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
Returns a reference to the value corresponding to the key.
sourcepub fn get_key_value<Q>(&'a self, key: &Q) -> Option<(&'a K, &'a V)>where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn get_key_value<Q>(&'a self, key: &Q) -> Option<(&'a K, &'a V)>where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
Returns the key-value pair corresponding to the supplied key.
sourcepub fn iter(&'a self) -> impl Iterator<Item = (&'a K, &'a V)> + 'a
pub fn iter(&'a self) -> impl Iterator<Item = (&'a K, &'a V)> + 'a
An iterator visiting all key-value pairs in arbitrary order. The iterator element type is (&'a K, &'a V)
.