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
sourceimpl<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
.
sourceimpl<'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) -> bool where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn contains_key<Q>(&'a self, key: &Q) -> bool where
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)
.
Trait Implementations
sourceimpl<K: Eq + Hash + Debug, V: Debug, S: BuildHasher + Clone> Debug for ReadOnlyView<K, V, S>
impl<K: Eq + Hash + Debug, V: Debug, S: BuildHasher + Clone> Debug for ReadOnlyView<K, V, S>
sourceimpl<'a, K, V, S> IntoParallelIterator for &'a ReadOnlyView<K, V, S> where
K: Send + Sync + Eq + Hash,
V: Send + Sync,
S: Send + Sync + Clone + BuildHasher,
impl<'a, K, V, S> IntoParallelIterator for &'a ReadOnlyView<K, V, S> where
K: Send + Sync + Eq + Hash,
V: Send + Sync,
S: Send + Sync + Clone + BuildHasher,
sourceimpl<K, V, S> IntoParallelIterator for ReadOnlyView<K, V, S> where
K: Send + Eq + Hash,
V: Send,
S: Send + Clone + BuildHasher,
impl<K, V, S> IntoParallelIterator for ReadOnlyView<K, V, S> where
K: Send + Eq + Hash,
V: Send,
S: Send + Clone + BuildHasher,
type Iter = OwningIter<K, V, S>
type Iter = OwningIter<K, V, S>
The parallel iterator type that will be created.
sourcefn into_par_iter(self) -> Self::Iter
fn into_par_iter(self) -> Self::Iter
Converts self
into a parallel iterator. Read more
Auto Trait Implementations
impl<K, V, S = RandomState> !RefUnwindSafe for ReadOnlyView<K, V, S>
impl<K, V, S> Send for ReadOnlyView<K, V, S> where
K: Send,
S: Send,
V: Send,
impl<K, V, S> Sync for ReadOnlyView<K, V, S> where
K: Send + Sync,
S: Send + Sync,
V: Send + Sync,
impl<K, V, S> Unpin for ReadOnlyView<K, V, S> where
S: Unpin,
impl<K, V, S> UnwindSafe for ReadOnlyView<K, V, S> where
K: UnwindSafe,
S: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'data, I> IntoParallelRefIterator<'data> for I where
I: 'data + ?Sized,
&'data I: IntoParallelIterator,
impl<'data, I> IntoParallelRefIterator<'data> for I where
I: 'data + ?Sized,
&'data I: IntoParallelIterator,
type Iter = <&'data I as IntoParallelIterator>::Iter
type Iter = <&'data I as IntoParallelIterator>::Iter
The type of the parallel iterator that will be returned.
type Item = <&'data I as IntoParallelIterator>::Item
type Item = <&'data I as IntoParallelIterator>::Item
The type of item that the parallel iterator will produce.
This will typically be an &'data T
reference type. Read more
sourcefn par_iter(&'data self) -> <I as IntoParallelRefIterator<'data>>::Iter
fn par_iter(&'data self) -> <I as IntoParallelRefIterator<'data>>::Iter
Converts self
into a parallel iterator. Read more