pub struct OccupiedEntry<'a, K, V, S> { /* private fields */ }
Implementations§
Source§impl<'a, K, V, S> OccupiedEntry<'a, K, V, S>
impl<'a, K, V, S> OccupiedEntry<'a, K, V, S>
pub fn key(&self) -> &K
pub fn remove_entry(self) -> (K, V)
pub fn get(&self) -> &V
pub fn get_mut(&mut self) -> &mut V
pub fn into_mut(self) -> &'a mut V
pub fn to_back(&mut self)
pub fn to_front(&mut self)
Sourcepub fn insert(&mut self, value: V) -> V
pub fn insert(&mut self, value: V) -> V
Replaces this entry’s value with the provided value.
Similarly to LinkedHashMap::insert
, this moves the existing entry to the back of the
internal linked list.
pub fn remove(self) -> V
Sourcepub fn insert_entry(self, value: V) -> (K, V)
pub fn insert_entry(self, value: V) -> (K, V)
Similar to OccupiedEntry::replace_entry
, but does move the entry to the back of the
internal linked list.
Sourcepub fn cursor_mut(self) -> CursorMut<'a, K, V, S>
pub fn cursor_mut(self) -> CursorMut<'a, K, V, S>
Returns a CursorMut
over the current entry.
Sourcepub fn replace_entry(self, value: V) -> (K, V)
pub fn replace_entry(self, value: V) -> (K, V)
Replaces the entry’s key with the key provided to LinkedHashMap::entry
, and replaces the
entry’s value with the given value
parameter.
Does not move the entry to the back of the internal linked list.
Sourcepub fn replace_key(self) -> K
pub fn replace_key(self) -> K
Replaces this entry’s key with the key provided to LinkedHashMap::entry
.
Does not move the entry to the back of the internal linked list.
Trait Implementations§
Auto Trait Implementations§
impl<'a, K, V, S> Freeze for OccupiedEntry<'a, K, V, S>where
K: Freeze,
impl<'a, K, V, S> RefUnwindSafe for OccupiedEntry<'a, K, V, S>
impl<'a, K, V, S> Send for OccupiedEntry<'a, K, V, S>
impl<'a, K, V, S> Sync for OccupiedEntry<'a, K, V, S>
impl<'a, K, V, S> Unpin for OccupiedEntry<'a, K, V, S>where
K: Unpin,
impl<'a, K, V, S> !UnwindSafe for OccupiedEntry<'a, K, V, S>
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