[][src]Struct ev_slotmap::MapReadRef

pub struct MapReadRef<'rh, K, P, V> where
    K: Key<P>, 
{ /* fields omitted */ }

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]

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

impl<'rh, K: Debug, P: Debug, V: Debug> Debug for MapReadRef<'rh, K, P, V> where
    K: Key<P>, 
[src]

Auto Trait Implementations

impl<'rh, K, P, V> RefUnwindSafe for MapReadRef<'rh, K, P, V> where
    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

impl<'rh, K, P, V> UnwindSafe for MapReadRef<'rh, K, P, V> where
    K: UnwindSafe,
    P: UnwindSafe,
    V: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.