pub struct OccupiedEntry<'a, K, V, const PREFIX_LEN: usize = DEFAULT_PREFIX_LEN, A: Allocator = Global> {
pub(crate) map: &'a mut TreeMap<K, V, PREFIX_LEN, A>,
pub(crate) delete_point: DeletePoint<K, V, PREFIX_LEN>,
}Fields§
§map: &'a mut TreeMap<K, V, PREFIX_LEN, A>Used for the removal
delete_point: DeletePoint<K, V, PREFIX_LEN>The point in the tree that would be removed if requested.
Implementations§
Source§impl<'a, K, V, const PREFIX_LEN: usize, A: Allocator> OccupiedEntry<'a, K, V, PREFIX_LEN, A>where
K: AsBytes,
impl<'a, K, V, const PREFIX_LEN: usize, A: Allocator> OccupiedEntry<'a, K, V, PREFIX_LEN, A>where
K: AsBytes,
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.
If you need a reference to the OccupiedEntry which may outlive the
destruction of the Entry value, see OccupiedEntry::into_mut.
Sourcepub fn insert(&mut self, value: V) -> V
pub fn insert(&mut self, value: V) -> V
Sets the value of the entry, and returns the entry’s old value.
Sourcepub fn into_mut(self) -> &'a mut V
pub fn into_mut(self) -> &'a mut V
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
OccupiedEntry::get_mut.
Sourcepub fn remove_entry(self) -> (K, V)
pub fn remove_entry(self) -> (K, V)
Takes the entry out of the map and returns it.
Trait Implementations§
Source§impl<'a, K: Debug, V: Debug, const PREFIX_LEN: usize, A: Debug + Allocator> Debug for OccupiedEntry<'a, K, V, PREFIX_LEN, A>
impl<'a, K: Debug, V: Debug, const PREFIX_LEN: usize, A: Debug + Allocator> Debug for OccupiedEntry<'a, K, V, PREFIX_LEN, A>
impl<K: Send, V: Send, const PREFIX_LEN: usize, A: Send + Allocator> Send for OccupiedEntry<'_, K, V, PREFIX_LEN, A>
impl<K: Sync, V: Sync, const PREFIX_LEN: usize, A: Sync + Allocator> Sync for OccupiedEntry<'_, K, V, PREFIX_LEN, A>
Auto Trait Implementations§
impl<'a, K, V, const PREFIX_LEN: usize, A> Freeze for OccupiedEntry<'a, K, V, PREFIX_LEN, A>
impl<'a, K, V, const PREFIX_LEN: usize, A> RefUnwindSafe for OccupiedEntry<'a, K, V, PREFIX_LEN, A>
impl<'a, K, V, const PREFIX_LEN: usize, A> Unpin for OccupiedEntry<'a, K, V, PREFIX_LEN, A>
impl<'a, K, V, const PREFIX_LEN: usize, A> UnsafeUnpin for OccupiedEntry<'a, K, V, PREFIX_LEN, A>
impl<'a, K, V, const PREFIX_LEN: usize = DEFAULT_PREFIX_LEN, A = Global> !UnwindSafe for OccupiedEntry<'a, K, V, PREFIX_LEN, A>
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