pub struct OccupiedEntry<'a, T> { /* private fields */ }Expand description
Implementations§
Source§impl<'a, T> OccupiedEntry<'a, T>
impl<'a, T> OccupiedEntry<'a, T>
Sourcepub fn get_mut(&mut self) -> &mut T
pub fn get_mut(&mut self) -> &mut T
Gets a mutable reference to the value within Some.
If you need a reference to the OccupiedEntry that may outlive the destruction of the Entry value, see into_mut.
Sourcepub fn insert(&mut self, value: T) -> T
pub fn insert(&mut self, value: T) -> T
Option::replace. Returns T instead of Option<T>, like mem::replace(x, value)
within if let Some(x) = o context.
Sourcepub fn into_mut(self) -> &'a mut T
pub fn into_mut(self) -> &'a mut T
Converts the entry into a mutable reference to its value.
If you need multiple references to the OccupiedEntry, see get_mut.
Sourcepub fn remove(self) -> T
pub fn remove(self) -> T
Option::take. Returns T instead of Option<T>.
This method is the main reason for this crate to exist: this allows avoiding doing
double-checks in code that needs to do deferred take.
Auto Trait Implementations§
impl<'a, T> Freeze for OccupiedEntry<'a, T>
impl<'a, T> RefUnwindSafe for OccupiedEntry<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for OccupiedEntry<'a, T>where
T: Send,
impl<'a, T> Sync for OccupiedEntry<'a, T>where
T: Sync,
impl<'a, T> Unpin for OccupiedEntry<'a, T>
impl<'a, T> !UnwindSafe for OccupiedEntry<'a, T>
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