pub struct VacantEntry<'a, K: Key, V, const PAGE: usize = DEFAULT_PAGE, D: Directory = Flat> { /* private fields */ }Expand description
An Entry for a key that is absent from the map.
Implementations§
Source§impl<'a, K: Key, V, const PAGE: usize, D: Directory> VacantEntry<'a, K, V, PAGE, D>
impl<'a, K: Key, V, const PAGE: usize, D: Directory> VacantEntry<'a, K, V, PAGE, D>
Sourcepub fn key(&self) -> &K
pub fn key(&self) -> &K
The key given to PagedSparseMap::entry.
Sourcepub fn insert(self, value: V) -> &'a mut V
pub fn insert(self, value: V) -> &'a mut V
Stores value for the key and returns mutable access to it, evicting
and dropping any other generation in the slot.
§Panics
As PagedSparseMap::insert. If an evicted value’s destructor panics,
the new entry is already in place.
Trait Implementations§
Auto Trait Implementations§
impl<'a, K, V, const PAGE: usize = DEFAULT_PAGE, D = Flat> !UnwindSafe for VacantEntry<'a, K, V, PAGE, D>
impl<'a, K, V, const PAGE: usize, D> Forget for VacantEntry<'a, K, V, PAGE, D>
impl<'a, K, V, const PAGE: usize, D> Freeze for VacantEntry<'a, K, V, PAGE, D>
impl<'a, K, V, const PAGE: usize, D> Move for VacantEntry<'a, K, V, PAGE, D>
impl<'a, K, V, const PAGE: usize, D> RefUnwindSafe for VacantEntry<'a, K, V, PAGE, D>
impl<'a, K, V, const PAGE: usize, D> Send for VacantEntry<'a, K, V, PAGE, D>
impl<'a, K, V, const PAGE: usize, D> Sync for VacantEntry<'a, K, V, PAGE, D>
impl<'a, K, V, const PAGE: usize, D> Unpin for VacantEntry<'a, K, V, PAGE, D>
impl<'a, K, V, const PAGE: usize, D> UnsafeUnpin for VacantEntry<'a, K, V, PAGE, D>
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