pub struct LeafNode<K, V> { /* private fields */ }Implementations§
Source§impl<K, V> Leaf<K, V>
impl<K, V> Leaf<K, V>
pub fn new(parent: Option<usize>, item: Item<K, V>) -> Leaf<K, V>
pub fn parent(&self) -> Option<usize>
pub fn set_parent(&mut self, p: Option<usize>)
pub fn item_count(&self) -> usize
pub fn items(&self) -> &[Item<K, V>]
pub fn iter(&self) -> Iter<'_, Item<K, V>>
pub fn get<Q>(&self, key: &Q) -> Option<&V>
pub fn get_mut<Q>(&mut self, key: &Q) -> Option<&mut V>
Sourcepub fn offset_of<Q>(&self, key: &Q) -> Result<Offset, Offset>
pub fn offset_of<Q>(&self, key: &Q) -> Result<Offset, Offset>
Find the offset of the item matching the given key.
pub fn item(&self, offset: Offset) -> Option<&Item<K, V>>
pub fn item_mut(&mut self, offset: Offset) -> Option<&mut Item<K, V>>
pub fn insert_by_key(&mut self, key: K, value: V) -> (Offset, Option<V>)where
K: Ord,
pub fn split(&mut self) -> (usize, Item<K, V>, Leaf<K, V>)
pub fn append(&mut self, separator: Item<K, V>, other: Leaf<K, V>) -> Offset
pub fn push_left(&mut self, item: Item<K, V>)
pub fn pop_left(&mut self) -> Result<Item<K, V>, WouldUnderflow>
pub fn push_right(&mut self, item: Item<K, V>) -> Offset
pub fn pop_right(&mut self) -> Result<(Offset, Item<K, V>), WouldUnderflow>
pub fn balance(&self) -> Balance
pub fn is_overflowing(&self) -> bool
pub fn is_underflowing(&self) -> bool
Sourcepub fn insert(&mut self, offset: Offset, item: Item<K, V>)
pub fn insert(&mut self, offset: Offset, item: Item<K, V>)
It is assumed that the leaf will not overflow.
Sourcepub fn remove(&mut self, offset: Offset) -> Item<K, V>
pub fn remove(&mut self, offset: Offset) -> Item<K, V>
Remove the item at the given offset. Return the new balance of the leaf.
pub fn remove_last(&mut self) -> Item<K, V>
pub fn validate(&self, parent: Option<usize>, min: Option<&K>, max: Option<&K>)where
K: Ord,
Trait Implementations§
Auto Trait Implementations§
impl<K, V> Freeze for Leaf<K, V>
impl<K, V> RefUnwindSafe for Leaf<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Leaf<K, V>
impl<K, V> Sync for Leaf<K, V>
impl<K, V> Unpin for Leaf<K, V>
impl<K, V> UnwindSafe for Leaf<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