pub enum Entry<'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,{
Vacant(VacantEntry<'a, 's, A, K, V, B>),
Occupied(OccupiedEntry<'a, 's, A, K, V, B>),
}Expand description
A view into a single entry in a map, which may either be vacant or occupied.
This enum is constructed from the entry method on
CompressedBTreeMap.
Variants§
Vacant(VacantEntry<'a, 's, A, K, V, B>)
A vacant entry.
Occupied(OccupiedEntry<'a, 's, A, K, V, B>)
An occupied entry.
Implementations§
Source§impl<'a, 's, A: Allocator, K: PartialOrd + Debug, V, B: ArrayLength> Entry<'a, 's, A, K, V, B>
impl<'a, 's, A: Allocator, K: PartialOrd + Debug, V, B: ArrayLength> Entry<'a, 's, A, K, V, B>
Sourcepub fn and_modify<F>(self, f: F) -> Self
pub fn and_modify<F>(self, f: F) -> Self
Provides in-place mutable access to an occupied entry before any potential inserts into the map.
Sourcepub fn insert(self, v: V) -> AllocResult<Option<V>>
pub fn insert(self, v: V) -> AllocResult<Option<V>>
Ensures a value is in the entry by inserting the provided value if empty, and returns the old value if the entry was occupied.
§Errors
Will return Err if the allocation fails.
Sourcepub fn unwrap_occupied(self) -> OccupiedEntry<'a, 's, A, K, V, B>
pub fn unwrap_occupied(self) -> OccupiedEntry<'a, 's, A, K, V, B>
Returns the OccupiedEntry if this entry is occupied, panics otherwise.
Auto Trait Implementations§
impl<'a, 's, A, K, V, B> Freeze for Entry<'a, 's, A, K, V, B>
impl<'a, 's, A, K, V, B> !RefUnwindSafe for Entry<'a, 's, A, K, V, B>
impl<'a, 's, A, K, V, B> !Send for Entry<'a, 's, A, K, V, B>
impl<'a, 's, A, K, V, B> !Sync for Entry<'a, 's, A, K, V, B>
impl<'a, 's, A, K, V, B> Unpin for Entry<'a, 's, A, K, V, B>
impl<'a, 's, A, K, V, B> !UnwindSafe for Entry<'a, 's, A, K, V, B>
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