[−][src]Struct ev_slotmap::MapReadRef
A live reference into the read half of an evmap.
As long as this lives, the map being read cannot change, and if a writer attempts to call any write method, that call will block until this is dropped, so make sure these are dropped as soon as possible
Since the map remains immutable while this lives, the methods on this type all give you unguarded references to types contained in the map.
Implementations
impl<'rh, K, P, V> MapReadRef<'rh, K, P, V> where
K: Key<P>,
[src]
K: Key<P>,
pub fn len(&self) -> usize
[src]
Returns the number of non-empty keys present in the map.
pub fn is_empty(&self) -> bool
[src]
Returns true if the map contains no elements.
pub fn iter(&self) -> impl Iterator<Item = &V>
[src]
Get an iterator over all the items in the slot map
pub fn get<'a>(&'a self, key: &K) -> Option<&'a V>
[src]
Returns a reference to the values corresponding to the key.
The key may be any borrowed form of the map's key type, but Hash
and Eq
on the borrowed
form must match those for the key type.
Note that not all writes will be included with this read -- only those that have been
refreshed by the writer. If no refresh has happened, or the map has been destroyed, this
function returns None
.
pub fn contains_key(&self, key: &K) -> bool
[src]
Returns true if the map contains any values for the specified key.
The key may be any borrowed form of the map's key type, but Hash
and Eq
on the borrowed
form must match those for the key type.
Trait Implementations
Auto Trait Implementations
impl<'rh, K, P, V> RefUnwindSafe for MapReadRef<'rh, K, P, V> where
K: RefUnwindSafe,
P: RefUnwindSafe,
V: RefUnwindSafe,
K: RefUnwindSafe,
P: RefUnwindSafe,
V: RefUnwindSafe,
impl<'rh, K, P, V> !Send for MapReadRef<'rh, K, P, V>
impl<'rh, K, P, V> !Sync for MapReadRef<'rh, K, P, V>
impl<'rh, K, P, V> Unpin for MapReadRef<'rh, K, P, V> where
K: Unpin,
P: Unpin,
K: Unpin,
P: Unpin,
impl<'rh, K, P, V> UnwindSafe for MapReadRef<'rh, K, P, V> where
K: UnwindSafe,
P: UnwindSafe,
V: RefUnwindSafe,
K: UnwindSafe,
P: UnwindSafe,
V: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,