VacantEntry

Struct VacantEntry 

Source
pub struct VacantEntry<'s, T: 'static, C: Config> { /* private fields */ }
Expand description

A handle to a vacant entry in an IDR.

It allows constructing values with the key that they will be assigned to.

See Idr::vacant_entry() for more details.

Implementations§

Source§

impl<'s, T: 'static, C: Config> VacantEntry<'s, T, C>

Source

pub fn key(&self) -> Key

Returns the key at which this entry will be inserted.

An entry stored in this entry will be associated with this key.

Source

pub fn insert(self, value: T)

Inserts a value in the IDR.

This method is wait-free.

To get the key at which this value will be inserted, use VacantEntry::key() prior to calling this method.

Trait Implementations§

Source§

impl<T, C: Config> Debug for VacantEntry<'_, T, C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: 'static, C: Config> Drop for VacantEntry<'_, T, C>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'s, T, C> Freeze for VacantEntry<'s, T, C>

§

impl<'s, T, C> RefUnwindSafe for VacantEntry<'s, T, C>
where C: RefUnwindSafe,

§

impl<'s, T, C> Send for VacantEntry<'s, T, C>
where T: Send + Sync, C: Sync,

§

impl<'s, T, C> Sync for VacantEntry<'s, T, C>
where T: Send + Sync, C: Sync,

§

impl<'s, T, C> Unpin for VacantEntry<'s, T, C>

§

impl<'s, T, C> UnwindSafe for VacantEntry<'s, T, C>
where C: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.