Enum ra_ap_la_arena::Entry
source · pub enum Entry<'a, IDX, V> {
Vacant(VacantEntry<'a, IDX, V>),
Occupied(OccupiedEntry<'a, IDX, V>),
}
Expand description
Variants§
Vacant(VacantEntry<'a, IDX, V>)
A vacant entry.
Occupied(OccupiedEntry<'a, IDX, V>)
An occupied entry.
Implementations§
source§impl<'a, IDX, V> Entry<'a, IDX, V>
impl<'a, IDX, V> Entry<'a, IDX, 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: FnOnce() -> V>(self, default: F) -> &'a mut V
pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut 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 and_modify<F: FnOnce(&mut V)>(self, f: F) -> Self
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.