struct LeafNode<K, V> {
    parent: Option<NonNull<InternalNode<K, V>>>,
    parent_idx: MaybeUninit<u16>,
    len: u16,
    keys: [MaybeUninit<K>; 11],
    vals: [MaybeUninit<V>; 11],
}
Expand description

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 K and V.

§parent_idx: MaybeUninit<u16>

This node’s index into the parent node’s edges array. *node.parent.edges[node.parent_idx] should be the same thing as node. This is only guaranteed to be initialized when parent is non-null.

§len: u16

The number of keys and values this node stores.

§keys: [MaybeUninit<K>; 11]

The arrays storing the actual data of the node. Only the first len elements of each array are initialized and valid.

§vals: [MaybeUninit<V>; 11]

Implementations§

source§

impl<K, V> LeafNode<K, V>

source

unsafe fn init(this: *mut Self)

Initializes a new LeafNode in-place.

source

fn new<A: Allocator + Clone>(alloc: A) -> Box<Self, A>

Creates a new boxed LeafNode.

Auto Trait Implementations§

§

impl<K, V> RefUnwindSafe for LeafNode<K, V>where K: RefUnwindSafe, V: RefUnwindSafe,

§

impl<K, V> !Send for LeafNode<K, V>

§

impl<K, V> !Sync for LeafNode<K, V>

§

impl<K, V> Unpin for LeafNode<K, V>where K: Unpin, V: Unpin,

§

impl<K, V> UnwindSafe for LeafNode<K, V>where K: UnwindSafe + RefUnwindSafe, V: UnwindSafe + RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.