VacantEntry

Struct VacantEntry 

Source
pub struct VacantEntry<'a, 's, A: Allocator, K: PartialOrd + Debug, V, B: ArrayLength>
where U2: Mul<B>, Prod<U2, B>: ArrayLength, U1: Add<Prod<U2, B>>, Sum<U1, Prod<U2, B>>: ArrayLength,
{ /* private fields */ }
Expand description

A view into a vacant entry in a CompressedBTreeMap. It is part of the Entry enum.

Implementations§

Source§

impl<'a, 's, A: Allocator, K: PartialOrd + Debug, V, B: ArrayLength> VacantEntry<'a, 's, A, K, V, B>
where U2: Mul<B>, Prod<U2, B>: ArrayLength, U1: Add<Prod<U2, B>>, Sum<U1, Prod<U2, B>>: ArrayLength,

Source

pub fn key(&self) -> &K

Gets a reference to the key that would be used when inserting a value through the VacantEntry.

Source

pub fn into_key(self) -> K

Takes ownership of the key.

Source

pub fn key_below(&self) -> Option<&K>

Returns a reference to the key that would be immediately below (predecessor of) the vacant entry’s key in the tree’s sorted order. Returns None if the vacant entry would be the minimum key.

Source

pub fn key_above(&self) -> Option<&K>

Returns a reference to the key that would be immediately above (successor of) the vacant entry’s key in the tree’s sorted order. Returns None if the vacant entry would be the maximum key.

Source

pub fn value_below(&self) -> Option<&V>

Returns a reference to the value that would be immediately below (predecessor of) the vacant entry’s key in the tree’s sorted order. Returns None if the vacant entry would be the minimum key.

Source

pub fn value_above(&self) -> Option<&V>

Returns a reference to the value that would be immediately above (successor of) the vacant entry’s key in the tree’s sorted order. Returns None if the vacant entry would be the maximum key.

Source

pub fn below(&self) -> Option<(&K, &V)>

Returns a reference to the key-value pair that would be immediately below (predecessor of) the vacant entry’s key in the tree’s sorted order. Returns None if the vacant entry would be the minimum key.

Source

pub fn above(&self) -> Option<(&K, &V)>

Returns a reference to the key-value pair that would be immediately above (successor of) the vacant entry’s key in the tree’s sorted order. Returns None if the vacant entry would be the maximum key.

Source

pub fn insert(self, value: V) -> AllocResult<Option<V>>

Sets the value of the entry with the VacantEntry’s key, and returns None.

§Errors

Will return Err if the allocation fails.

Auto Trait Implementations§

§

impl<'a, 's, A, K, V, B> Freeze for VacantEntry<'a, 's, A, K, V, B>
where <UInt<UTerm, B1> as Add<<UInt<UInt<UTerm, B1>, B0> as Mul<B>>::Output>>::Output: Sized, <UInt<UInt<UTerm, B1>, B0> as Mul<B>>::Output: Sized, K: Freeze,

§

impl<'a, 's, A, K, V, B> !RefUnwindSafe for VacantEntry<'a, 's, A, K, V, B>

§

impl<'a, 's, A, K, V, B> !Send for VacantEntry<'a, 's, A, K, V, B>

§

impl<'a, 's, A, K, V, B> !Sync for VacantEntry<'a, 's, A, K, V, B>

§

impl<'a, 's, A, K, V, B> Unpin for VacantEntry<'a, 's, A, K, V, B>
where <UInt<UTerm, B1> as Add<<UInt<UInt<UTerm, B1>, B0> as Mul<B>>::Output>>::Output: Sized, <UInt<UInt<UTerm, B1>, B0> as Mul<B>>::Output: Sized, K: Unpin,

§

impl<'a, 's, A, K, V, B> !UnwindSafe for VacantEntry<'a, 's, A, K, V, B>

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> Same for T

Source§

type Output = T

Should always be Self
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.