pub struct OccupiedEntry<'a, C: ?Sized> { /* private fields */ }
Implementations§
Source§impl<'a, C: 'a + Entriable> OccupiedEntry<'a, C>
impl<'a, C: 'a + Entriable> OccupiedEntry<'a, C>
Sourcepub fn remove_entry(self) -> (usize, C::T)
pub fn remove_entry(self) -> (usize, C::T)
Take the ownership of the index and value from the container.
Sourcepub fn get_mut(&mut self) -> &mut C::T
pub fn get_mut(&mut self) -> &mut C::T
Gets a mutable reference to the value in the entry.
If you need a reference to the OccupiedEntry
which may outlive the
destruction of the Entry
value, see into_mut
.
Sourcepub fn into_mut(self) -> &'a mut C::T
pub fn into_mut(self) -> &'a mut C::T
Converts the OccupiedEntry into a mutable reference to the value in the entry with a lifetime bound to the map itself.
If you need multiple references to the OccupiedEntry
, see get_mut
.
Sourcepub fn insert(&mut self, value: C::T) -> C::T
pub fn insert(&mut self, value: C::T) -> C::T
Sets the value of the entry, and returns the entry’s old value.
Sourcepub fn remove(self) -> C::T
pub fn remove(self) -> C::T
Takes the value out of the entry, and returns it. Keeps the allocated memory for reuse.
Sourcepub fn replace_entry(self, value: C::T) -> (usize, C::T)
pub fn replace_entry(self, value: C::T) -> (usize, C::T)
Replaces the entry, returning the index and value.
Auto Trait Implementations§
impl<'a, C> Freeze for OccupiedEntry<'a, C>where
C: ?Sized,
impl<'a, C> RefUnwindSafe for OccupiedEntry<'a, C>where
C: RefUnwindSafe + ?Sized,
impl<'a, C> Send for OccupiedEntry<'a, C>
impl<'a, C> Sync for OccupiedEntry<'a, C>
impl<'a, C> Unpin for OccupiedEntry<'a, C>where
C: ?Sized,
impl<'a, C> !UnwindSafe for OccupiedEntry<'a, C>
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