Struct VacantEntry
struct VacantEntry<'a, T> { ... }
A handle to a vacant entry in a Slab.
VacantEntry allows constructing values with the key that they will be
assigned to.
Examples
# use *;
let mut slab = new;
let hello = ;
assert_eq!;
assert_eq!;
Implementations
impl<'a, T> VacantEntry<'a, T>
fn insert(self: Self, val: T) -> &'a mut TInsert a value in the entry, returning a mutable reference to the value.
To get the key associated with the value, use
keyprior to callinginsert.Examples
# use *; let mut slab = new; let hello = ; assert_eq!; assert_eq!;fn key(self: &Self) -> usizeReturn the key associated with this entry.
A value stored in this entry will be associated with this key.
Examples
# use *; let mut slab = new; let hello = ; assert_eq!; assert_eq!;
impl<'a, T> Freeze for VacantEntry<'a, T>
impl<'a, T> RefUnwindSafe for VacantEntry<'a, T>
impl<'a, T> Send for VacantEntry<'a, T>
impl<'a, T> Sync for VacantEntry<'a, T>
impl<'a, T> Unpin for VacantEntry<'a, T>
impl<'a, T> UnsafeUnpin for VacantEntry<'a, T>
impl<'a, T> UnwindSafe for VacantEntry<'a, T>
impl<'a, T: $crate::fmt::Debug> Debug for VacantEntry<'a, T>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<T> Any for VacantEntry<'a, T>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for VacantEntry<'a, T>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for VacantEntry<'a, T>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for VacantEntry<'a, T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for VacantEntry<'a, T>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for VacantEntry<'a, T>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for VacantEntry<'a, T>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>