pub enum Entry<'a, K, V, Codec = Default> {
Occupied(OccupiedEntry<'a, K, V, Codec>),
Vacant(VacantEntry<'a, K, V, Codec>),
}Expand description
A view into a single entry in an observable hash map, which may either be vacant or occupied.
This is returned by ObservableHashMap::entry.
Variants§
Occupied(OccupiedEntry<'a, K, V, Codec>)
An occupied entry.
Vacant(VacantEntry<'a, K, V, Codec>)
A vacant entry.
Implementations§
Source§impl<'a, K, V, Codec> Entry<'a, K, V, Codec>
impl<'a, K, V, Codec> Entry<'a, K, V, Codec>
Sourcepub fn or_insert(self, default: V) -> RefMut<'a, K, V, Codec>
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub fn or_insert(self, default: V) -> RefMut<'a, K, V, Codec>
Ensures a value is in the entry by inserting the default if empty, and returns a mutable reference to the value in the entry.
Sourcepub fn or_insert_with<F: FnOnce() -> V>(
self,
default: F,
) -> RefMut<'a, K, V, Codec>
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub fn or_insert_with<F: FnOnce() -> V>( self, default: F, ) -> RefMut<'a, K, V, Codec>
Ensures a value is in the entry by inserting the result of the default function if empty, and returns a mutable reference to the value in the entry.
Sourcepub fn or_insert_with_key<F: FnOnce(&K) -> V>(
self,
default: F,
) -> RefMut<'a, K, V, Codec>
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub fn or_insert_with_key<F: FnOnce(&K) -> V>( self, default: F, ) -> RefMut<'a, K, V, Codec>
Ensures a value is in the entry by inserting the result of the default function with key as argument if empty, and returns a mutable reference to the value in the entry.
Sourcepub fn key(&self) -> &K
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub fn key(&self) -> &K
Returns a reference to this entry’s key.
Sourcepub fn and_modify<F: FnOnce(&mut V)>(self, f: F) -> Self
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub fn and_modify<F: FnOnce(&mut V)>(self, f: F) -> Self
Provides in-place mutable access to an occupied entry before any potential inserts into the map.
Source§impl<'a, K, V, Codec> Entry<'a, K, V, Codec>
impl<'a, K, V, Codec> Entry<'a, K, V, Codec>
Sourcepub fn or_default(self) -> RefMut<'a, K, V, Codec>
👎Deprecated: remoc-obs has been integrated into remoc as module remoc::robs. Please update your references.
pub fn or_default(self) -> RefMut<'a, K, V, Codec>
Ensures a value is in the entry by inserting the default value if empty, and returns a mutable reference to the value in the entry.