pub struct OccupiedEntry<'a, K: Key, V, const PAGE: usize = DEFAULT_PAGE, D: Directory = Flat> { /* private fields */ }Expand description
An Entry for a key that is in the map.
Implementations§
Source§impl<'a, K: Key, V, const PAGE: usize, D: Directory> OccupiedEntry<'a, K, V, PAGE, D>
impl<'a, K: Key, V, const PAGE: usize, D: Directory> OccupiedEntry<'a, K, V, PAGE, D>
Sourcepub fn into_mut(self) -> &'a mut V
pub fn into_mut(self) -> &'a mut V
Mutable access to the value for the lifetime of the map borrow.
Sourcepub fn insert(&mut self, value: V) -> V
pub fn insert(&mut self, value: V) -> V
Replaces the value and returns the old one, keeping the stored key.
Sourcepub fn remove_entry(self) -> (K, V)
pub fn remove_entry(self) -> (K, V)
Removes the entry and returns the stored key and its value.
The last entry moves into the removed entry’s position.
Trait Implementations§
Auto Trait Implementations§
impl<'a, K, V, const PAGE: usize = DEFAULT_PAGE, D = Flat> !UnwindSafe for OccupiedEntry<'a, K, V, PAGE, D>
impl<'a, K, V, const PAGE: usize, D> Forget for OccupiedEntry<'a, K, V, PAGE, D>
impl<'a, K, V, const PAGE: usize, D> Freeze for OccupiedEntry<'a, K, V, PAGE, D>where
&'a mut PagedSparseMap<K, V, PAGE, D>: Freeze,
impl<'a, K, V, const PAGE: usize, D> Move for OccupiedEntry<'a, K, V, PAGE, D>
impl<'a, K, V, const PAGE: usize, D> RefUnwindSafe for OccupiedEntry<'a, K, V, PAGE, D>where
&'a mut PagedSparseMap<K, V, PAGE, D>: RefUnwindSafe,
impl<'a, K, V, const PAGE: usize, D> Send for OccupiedEntry<'a, K, V, PAGE, D>where
&'a mut PagedSparseMap<K, V, PAGE, D>: Send,
impl<'a, K, V, const PAGE: usize, D> Sync for OccupiedEntry<'a, K, V, PAGE, D>where
&'a mut PagedSparseMap<K, V, PAGE, D>: Sync,
impl<'a, K, V, const PAGE: usize, D> Unpin for OccupiedEntry<'a, K, V, PAGE, D>where
&'a mut PagedSparseMap<K, V, PAGE, D>: Unpin,
impl<'a, K, V, const PAGE: usize, D> UnsafeUnpin for OccupiedEntry<'a, K, V, PAGE, D>where
&'a mut PagedSparseMap<K, V, PAGE, D>: UnsafeUnpin,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more