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.
Trait Implementations§
Auto Trait Implementations§
impl<'a, E, V> Freeze for EventIdMapEntry<'a, E, V>where
E: Freeze,
impl<'a, E, V> RefUnwindSafe for EventIdMapEntry<'a, E, V>where
E: RefUnwindSafe,
V: RefUnwindSafe,
impl<'a, E, V> Send for EventIdMapEntry<'a, E, V>
impl<'a, E, V> Sync for EventIdMapEntry<'a, E, V>
impl<'a, E, V> Unpin for EventIdMapEntry<'a, E, V>where
E: Unpin,
impl<'a, E, V> UnsafeUnpin for EventIdMapEntry<'a, E, V>where
E: UnsafeUnpin,
impl<'a, E, V> !UnwindSafe for EventIdMapEntry<'a, E, V>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more