pub struct OccupiedEntry<'a, K: 'a + WeakKey, V: 'a>(/* private fields */);
Expand description
An occupied entry, which can be removed or viewed.
Implementations§
Source§impl<'a, K: WeakKey, V> OccupiedEntry<'a, K, V>
impl<'a, K: WeakKey, V> OccupiedEntry<'a, K, V>
Sourcepub fn remove_entry(self) -> (K::Strong, V)
pub fn remove_entry(self) -> (K::Strong, V)
Takes ownership of the key and value from the map.
expected O(1) time; worst-case O(p) time
Sourcepub fn get_mut(&mut self) -> &mut V
pub fn get_mut(&mut self) -> &mut V
Gets a mutable reference to the value in the entry.
O(1) time
Sourcepub fn into_mut(self) -> &'a mut V
pub fn into_mut(self) -> &'a mut V
Turns the entry into a mutable reference to the value borrowed from the map.
O(1) time
Trait Implementations§
Auto Trait Implementations§
impl<'a, K, V> Freeze for OccupiedEntry<'a, K, V>
impl<'a, K, V> RefUnwindSafe for OccupiedEntry<'a, K, V>
impl<'a, K, V> Send for OccupiedEntry<'a, K, V>
impl<'a, K, V> Sync for OccupiedEntry<'a, K, V>
impl<'a, K, V> Unpin for OccupiedEntry<'a, K, V>
impl<'a, K, V> !UnwindSafe for OccupiedEntry<'a, K, 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