pub enum Entry<'a> {
Occupied(OccupiedEntry<'a>),
Vacant(VacantEntry<'a>),
}Expand description
A view into an occupied or vacant mapping entry.
Variants§
Implementations§
Source§impl<'a> Entry<'a>
impl<'a> Entry<'a>
Sourcepub fn or_insert(self, default: Value) -> &'a mut Value
pub fn or_insert(self, default: Value) -> &'a mut Value
Ensures a value is present and returns a mutable reference to it.
Sourcepub fn or_insert_with<F>(self, default: F) -> &'a mut Value
pub fn or_insert_with<F>(self, default: F) -> &'a mut Value
Ensures a lazily produced value is present.
Sourcepub fn and_modify<F>(self, modify: F) -> Self
pub fn and_modify<F>(self, modify: F) -> Self
Modifies an occupied entry before returning it.
Auto Trait Implementations§
impl<'a> !UnwindSafe for Entry<'a>
impl<'a> Freeze for Entry<'a>
impl<'a> RefUnwindSafe for Entry<'a>
impl<'a> Send for Entry<'a>
impl<'a> Sync for Entry<'a>
impl<'a> Unpin for Entry<'a>
impl<'a> UnsafeUnpin for Entry<'a>
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