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, V, S> ReadOnlyView<K, V, S>
impl<'a, K, V, S> 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
pub fn contains_key<Q>(&'a self, key: &Q) -> bool
Returns true if the map contains a value for the specified key.
Sourcepub fn get<Q>(&'a self, key: &Q) -> Option<&'a V>
pub fn get<Q>(&'a self, key: &Q) -> Option<&'a V>
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)>
pub fn get_key_value<Q>(&'a self, key: &Q) -> Option<(&'a K, &'a V)>
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§
Source§impl<K, V, S> Clone for ReadOnlyView<K, V, S>
impl<K, V, S> Clone for ReadOnlyView<K, V, S>
Source§fn clone(&self) -> ReadOnlyView<K, V, S>
fn clone(&self) -> ReadOnlyView<K, V, S>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<K, V, S> Debug for ReadOnlyView<K, V, S>
impl<K, V, S> Debug for ReadOnlyView<K, V, S>
Source§impl<'a, K, V, S> IntoParallelIterator for &'a ReadOnlyView<K, V, S>
impl<'a, K, V, S> IntoParallelIterator for &'a ReadOnlyView<K, V, S>
Source§fn into_par_iter(
self,
) -> <&'a ReadOnlyView<K, V, S> as IntoParallelIterator>::Iter
fn into_par_iter( self, ) -> <&'a ReadOnlyView<K, V, S> as IntoParallelIterator>::Iter
Converts
self into a parallel iterator. Read moreSource§impl<K, V, S> IntoParallelIterator for ReadOnlyView<K, V, S>
impl<K, V, S> IntoParallelIterator for ReadOnlyView<K, V, S>
Source§type Iter = OwningIter<K, V>
type Iter = OwningIter<K, V>
The parallel iterator type that will be created.
Source§fn into_par_iter(self) -> <ReadOnlyView<K, V, S> as IntoParallelIterator>::Iter
fn into_par_iter(self) -> <ReadOnlyView<K, V, S> as IntoParallelIterator>::Iter
Converts
self into a parallel iterator. Read moreAuto Trait Implementations§
impl<K, V, S> Freeze for ReadOnlyView<K, V, S>where
S: Freeze,
impl<K, V, S = RandomState> !RefUnwindSafe for ReadOnlyView<K, V, S>
impl<K, V, S> Send for ReadOnlyView<K, V, S>
impl<K, V, S> Sync for ReadOnlyView<K, V, S>
impl<K, V, S> Unpin for ReadOnlyView<K, V, S>where
S: Unpin,
impl<K, V, S> UnwindSafe for ReadOnlyView<K, V, S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more