pub enum Entry<'a, V> {
Occupied(OccupiedEntry<'a, V>),
Vacant(VacantEntry<'a, V>),
}
Expand description
An IntTable entry
Variants§
Implementations§
Source§impl<'a, V> Entry<'a, V>
impl<'a, V> Entry<'a, 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 default if empty, and returns a mutable reference to the value in the entry. Only calls the closure if the entry is empty.
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 the default if empty, and returns a mutable reference to the value in the entry. Only calls the closure if the entry is empty.
Sourcepub fn and_modify<F>(self, f: F) -> Self
pub fn and_modify<F>(self, f: F) -> Self
Provides in-place mutable access to an occupied entry before any potential inserts into the map
Sourcepub fn insert_entry(self, value: V) -> OccupiedEntry<'a, V>
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, V>
Sets the value of the entry and returns an OccupiedEntry
.
Trait Implementations§
Auto Trait Implementations§
impl<'a, V> Freeze for Entry<'a, V>
impl<'a, V> RefUnwindSafe for Entry<'a, V>where
V: RefUnwindSafe,
impl<'a, V> Send for Entry<'a, V>where
V: Send,
impl<'a, V> Sync for Entry<'a, V>where
V: Sync,
impl<'a, V> Unpin for Entry<'a, V>
impl<'a, V> !UnwindSafe for Entry<'a, 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
Mutably borrows from an owned value. Read more