pub struct InnerNode<K: Key, A: Argument<K>> { /* private fields */ }
Expand description
Tree’s inner node, it contains a list of keys and a list of child node id
N
is the maximum number of keys in a node
C
is the maximum child node id in a node
Implementations§
Source§impl<K: Key, A: Argument<K>> InnerNode<K, A>
impl<K: Key, A: Argument<K>> InnerNode<K, A>
Sourcepub const fn max_capacity() -> u16
pub const fn max_capacity() -> u16
Max key capacity
Sourcepub const fn split_origin_size() -> usize
pub const fn split_origin_size() -> usize
The size of the origin node after split
Sourcepub const fn split_new_size() -> usize
pub const fn split_new_size() -> usize
The size of the new node after split
Sourcepub fn able_to_lend(&self) -> bool
pub fn able_to_lend(&self) -> bool
whether this node is able to lend a key to its sibling
Sourcepub fn is_full(&self) -> bool
pub fn is_full(&self) -> bool
whether this node is full, if yes, then the next insert need to split
Sourcepub fn new_from_iter(
keys: impl IntoIterator<Item = K>,
childs: impl IntoIterator<Item = NodeId>,
arguments: impl IntoIterator<Item = A>,
) -> Box<Self>
pub fn new_from_iter( keys: impl IntoIterator<Item = K>, childs: impl IntoIterator<Item = NodeId>, arguments: impl IntoIterator<Item = A>, ) -> Box<Self>
Create a new inner node from keys and childs iterator
Sourcepub fn locate_child<Q>(&self, k: &Q) -> (usize, NodeId)
pub fn locate_child<Q>(&self, k: &Q) -> (usize, NodeId)
returns the child index for k
pub fn push(&mut self, k: K, child: NodeId, argument: A)
pub fn key(&self, idx: usize) -> &K
Trait Implementations§
Auto Trait Implementations§
impl<K, A> Freeze for InnerNode<K, A>
impl<K, A> RefUnwindSafe for InnerNode<K, A>where
K: RefUnwindSafe,
A: RefUnwindSafe,
impl<K, A> Send for InnerNode<K, A>
impl<K, A> Sync for InnerNode<K, A>
impl<K, A> Unpin for InnerNode<K, A>
impl<K, A> UnwindSafe for InnerNode<K, A>where
K: UnwindSafe,
A: UnwindSafe,
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