pub struct OccupiedEntry<'a, K: Ord + Clone + Sized, V: Sized> { /* private fields */ }Available on crate feature
btree only.Expand description
Entry for an existing key-value pair in the tree
Implementations§
Source§impl<'a, K: Ord + Clone + Sized, V: Sized> OccupiedEntry<'a, K, V>
impl<'a, K: Ord + Clone + Sized, V: Sized> OccupiedEntry<'a, K, V>
Sourcepub fn remove_entry(self) -> (K, V)
pub fn remove_entry(self) -> (K, V)
Remove the key-value pair from the tree and return the key and value
Sourcepub fn into_mut(self) -> &'a mut V
pub fn into_mut(self) -> &'a mut V
Convert the OccupiedEntry into a mutable reference bounded by the tree’s lifetime
Sourcepub fn peak_backward(&self) -> Option<(&'a K, &'a V)>
pub fn peak_backward(&self) -> Option<(&'a K, &'a V)>
Peak previous OccupiedEntry
Sourcepub fn peak_forward(&self) -> Option<(&'a K, &'a V)>
pub fn peak_forward(&self) -> Option<(&'a K, &'a V)>
Peak the next OccupiedEntry
Sourcepub fn move_backward(self) -> Result<Self, Self>
pub fn move_backward(self) -> Result<Self, Self>
Move to previous OccupiedEntry
When reaching the front, return the original entry in Err()
Sourcepub fn move_forward(self) -> Result<Self, Self>
pub fn move_forward(self) -> Result<Self, Self>
Move to next OccupiedEntry
When reaching the end, return the original entry in Err()
Trait Implementations§
Auto Trait Implementations§
impl<'a, K, V> Freeze for OccupiedEntry<'a, K, V>
impl<'a, K, V> RefUnwindSafe for OccupiedEntry<'a, K, V>
impl<'a, K, V> !Send for OccupiedEntry<'a, K, V>
impl<'a, K, V> !Sync for OccupiedEntry<'a, K, V>
impl<'a, K, V> Unpin for OccupiedEntry<'a, K, V>
impl<'a, K, V> UnsafeUnpin for OccupiedEntry<'a, K, V>
impl<'a, K, V> !UnwindSafe for OccupiedEntry<'a, K, V>
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