[][src]Enum typemap_rev::Entry

pub enum Entry<'a, K> where
    K: TypeMapKey
{ Occupied(OccupiedEntry<'a, K>), Vacant(VacantEntry<'a, K>), }

A view into a single entry in the TypeMap, which may either be vacant or occupied.

This heavily mirrors the official Entry API in the standard library, but not all of it is provided due to implementation restrictions. Please refer to its documentations.

Variants

Occupied(OccupiedEntry<'a, K>)
Vacant(VacantEntry<'a, K>)

Implementations

impl<'a, K> Entry<'a, K> where
    K: TypeMapKey
[src]

pub fn or_insert(self, value: K::Value) -> &'a mut K::Value[src]

pub fn or_insert_with<F>(self, f: F) -> &'a mut K::Value where
    F: FnOnce() -> K::Value
[src]

pub fn and_modify<F>(self, f: F) -> Self where
    F: FnOnce(&mut K::Value), 
[src]

impl<'a, K> Entry<'a, K> where
    K: TypeMapKey,
    K::Value: Default
[src]

pub fn or_default(self) -> &'a mut K::Value[src]

Auto Trait Implementations

impl<'a, K> !RefUnwindSafe for Entry<'a, K>

impl<'a, K> Send for Entry<'a, K> where
    <K as TypeMapKey>::Value: Sync

impl<'a, K> Sync for Entry<'a, K> where
    <K as TypeMapKey>::Value: Sync

impl<'a, K> Unpin for Entry<'a, K>

impl<'a, K> !UnwindSafe for Entry<'a, K>

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.