[−][src]Enum typemap_rev::Entry
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]
K: TypeMapKey,
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]
F: FnOnce() -> K::Value,
pub fn and_modify<F>(self, f: F) -> Self where
F: FnOnce(&mut K::Value),
[src]
F: FnOnce(&mut K::Value),
impl<'a, K> Entry<'a, K> where
K: TypeMapKey,
K::Value: Default,
[src]
K: TypeMapKey,
K::Value: Default,
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,
<K as TypeMapKey>::Value: Sync,
impl<'a, K> Sync for Entry<'a, K> where
<K as TypeMapKey>::Value: Sync,
<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]
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>,