pub struct EventIdMapEntry<'a, E, V>(/* private fields */)
where
E: Borrow<EventId>;state-res only.Expand description
A view into a single entry in an EventIdMap.
Implementations§
Source§impl<'a, E, V> EventIdMapEntry<'a, E, V>
impl<'a, E, V> EventIdMapEntry<'a, E, V>
Sourcepub fn or_insert(self, default: V) -> &'a mut V
pub fn or_insert(self, default: V) -> &'a mut V
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>(self, default: F) -> &'a mut Vwhere
F: FnOnce() -> V,
pub fn or_insert_with<F>(self, default: F) -> &'a mut Vwhere
F: FnOnce() -> V,
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>(self, default: F) -> &'a mut V
pub fn or_insert_with_key<F>(self, default: F) -> &'a mut V
Ensures a value is in the entry by inserting, if empty, the result of the default function.
This method allows for generating key-derived values for insertion by providing the default function a reference to the key that was moved during the .entry(key) method call.
Sourcepub fn insert_entry(self, value: V) -> &'a mut V
pub fn insert_entry(self, value: V) -> &'a mut V
Sets the value of the entry, and returns a mutable reference to the value.
Source§impl<'a, E, V> EventIdMapEntry<'a, E, V>
impl<'a, E, V> EventIdMapEntry<'a, E, V>
Sourcepub fn or_default(self) -> &'a mut V
pub fn or_default(self) -> &'a mut V
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.