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>
impl<'a, 's, A: Allocator, K: PartialOrd + Debug, V, B: ArrayLength> VacantEntry<'a, 's, A, K, V, B>
Sourcepub fn key(&self) -> &K
pub fn key(&self) -> &K
Gets a reference to the key that would be used when inserting a value through the VacantEntry.
Sourcepub fn key_below(&self) -> Option<&K>
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.
Sourcepub fn key_above(&self) -> Option<&K>
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.
Sourcepub fn value_below(&self) -> Option<&V>
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.
Sourcepub fn value_above(&self) -> Option<&V>
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.
Sourcepub fn below(&self) -> Option<(&K, &V)>
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.
Sourcepub fn above(&self) -> Option<(&K, &V)>
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.
Sourcepub fn insert(self, value: V) -> AllocResult<Option<V>>
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.