Struct weak_table::weak_key_hash_map::OccupiedEntry
source · [−]pub struct OccupiedEntry<'a, K: 'a + WeakKey, V: 'a>(_);
Expand description
An occupied entry, which can be removed or viewed.
Implementations
sourceimpl<'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> RefUnwindSafe for OccupiedEntry<'a, K, V> where
K: RefUnwindSafe,
V: RefUnwindSafe,
<K as WeakElement>::Strong: RefUnwindSafe,
impl<'a, K, V> Send for OccupiedEntry<'a, K, V> where
K: Send,
V: Send,
<K as WeakElement>::Strong: Send,
impl<'a, K, V> Sync for OccupiedEntry<'a, K, V> where
K: Sync,
V: Sync,
<K as WeakElement>::Strong: Sync,
impl<'a, K, V> Unpin for OccupiedEntry<'a, K, V> where
<K as WeakElement>::Strong: Unpin,
impl<'a, K, V> !UnwindSafe for OccupiedEntry<'a, K, V>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more