#[repr(u8)]
pub enum NodeType {
    Node4,
    Node16,
    Node48,
    Node256,
    Leaf,
}
Expand description

The representation of inner nodes

Variants§

§

Node4

Node that references between 2 and 4 children

§

Node16

Node that references between 5 and 16 children

§

Node48

Node that references between 17 and 49 children

§

Node256

Node that references between 49 and 256 children

§

Leaf

Node that contains a single value

Implementations§

source§

impl NodeType

source

pub const fn upper_capacity(self) -> usize

The upper bound on the number of child nodes that this NodeType can have.

source

pub const fn from_u8(src: u8) -> Option<NodeType>

Attempt to convert a u8 value to a NodeType, returning None if there is no match.

source

pub fn should_shrink_inner_node(self, num_children: usize) -> bool

Return true if an InnerNode with the given NodeType and specified number of children should be shrunk.

Panics
source

pub const fn capacity_range(self) -> Range<usize>

Return the range of number of children that each node type accepts.

Trait Implementations§

source§

impl Clone for NodeType

source§

fn clone(&self) -> NodeType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NodeType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<NodeType> for NodeType

source§

fn eq(&self, other: &NodeType) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for NodeType

source§

impl Eq for NodeType

source§

impl StructuralEq for NodeType

source§

impl StructuralPartialEq for NodeType

Auto Trait Implementations§

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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.