Struct LeafNode
pub(in ::collections::btree::node) struct LeafNode<K, V> { pub(in ::collections::btree::node) parent: Option<NonNull<InternalNode<K, V>>>, pub(in ::collections::btree::node) parent_idx: MaybeUninit<u16>, pub(in ::collections::btree::node) len: u16, pub(in ::collections::btree::node) keys: [MaybeUninit<K>; 11], pub(in ::collections::btree::node) vals: [MaybeUninit<V>; 11] }
The underlying representation of leaf nodes and part of the representation of internal nodes.
Fields
parent: Option<NonNull<InternalNode<K, V>>>We want to be covariant in
KandV.parent_idx: MaybeUninit<u16>This node's index into the parent node's
edgesarray.*node.parent.edges[node.parent_idx]should be the same thing asnode. This is only guaranteed to be initialized whenparentis non-null.len: u16The number of keys and values this node stores.
keys: [MaybeUninit<K>; 11]The arrays storing the actual data of the node. Only the first
lenelements of each array are initialized and valid.vals: [MaybeUninit<V>; 11]
Implementations
impl<K, V> LeafNode<K, V>
unsafe fn init(this: *mut Self)Initializes a new
LeafNodein-place.Safety
The caller must ensure that
thispoints to a (possibly uninitialized)LeafNodefn new<A: Allocator + Clone>(alloc: A) -> Box<Self, A>Creates a new boxed
LeafNode.
Auto Trait Implementations
impl<K, V> !Send for LeafNode<K, V>
impl<K, V> !Sync for LeafNode<K, V>
impl<K, V> Freeze for LeafNode<K, V>
where
Option<NonNull<InternalNode<K, V>>>: Freeze,
[MaybeUninit<K>; 11]: Freeze,
[MaybeUninit<V>; 11]: Freeze,
impl<K, V> RefUnwindSafe for LeafNode<K, V>
where
Option<NonNull<InternalNode<K, V>>>: RefUnwindSafe,
[MaybeUninit<K>; 11]: RefUnwindSafe,
[MaybeUninit<V>; 11]: RefUnwindSafe,
impl<K, V> Unpin for LeafNode<K, V>
where
Option<NonNull<InternalNode<K, V>>>: Unpin,
[MaybeUninit<K>; 11]: Unpin,
[MaybeUninit<V>; 11]: Unpin,
impl<K, V> UnsafeUnpin for LeafNode<K, V>
where
Option<NonNull<InternalNode<K, V>>>: UnsafeUnpin,
[MaybeUninit<K>; 11]: UnsafeUnpin,
[MaybeUninit<V>; 11]: UnsafeUnpin,
impl<K, V> UnwindSafe for LeafNode<K, V>
where
Option<NonNull<InternalNode<K, V>>>: UnwindSafe,
[MaybeUninit<K>; 11]: UnwindSafe,
[MaybeUninit<V>; 11]: UnwindSafe,
Blanket Implementations
impl<T> Any for LeafNode<K, V>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for LeafNode<K, V>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for LeafNode<K, V>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for LeafNode<K, V>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for LeafNode<K, V>
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for LeafNode<K, V>
impl<T, U> Into<U> for LeafNode<K, V>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for LeafNode<K, V>
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for LeafNode<K, V>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>