pub struct InnerNode48<K, V> {
    pub header: Header,
    pub child_indices: [RestrictedNodeIndex<48>; 256],
    pub child_pointers: [MaybeUninit<OpaqueNodePtr<K, V>>; 48],
}
Expand description

Node that references between 17 and 49 children

Fields§

§header: Header

The common node fields.

§child_indices: [RestrictedNodeIndex<48>; 256]

An array that maps key bytes (as the index) to the index value in the child_pointers array.

All the child_indices values are guaranteed to be PartialNodeIndex<48>::EMPTY when the node is constructed.

§child_pointers: [MaybeUninit<OpaqueNodePtr<K, V>>; 48]

For each element in this array, it is assumed to be initialized if there is a index in the child_indices array that points to it

Implementations§

source§

impl<K, V> InnerNode48<K, V>

source

pub fn empty() -> Self

Create an empty Node48.

source

pub fn initialized_child_pointers(&self) -> &[OpaqueNodePtr<K, V>]

Return the initialized portions of the child pointer array.

Trait Implementations§

source§

impl<K, V> Clone for InnerNode48<K, V>

source§

fn clone(&self) -> Self

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<K, V> Debug for InnerNode48<K, V>

source§

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

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

impl<K, V> InnerNode for InnerNode48<K, V>

§

type GrownNode = InnerNode256<<InnerNode48<K, V> as Node>::Key, <InnerNode48<K, V> as Node>::Value>

The type of the next larger node type.
§

type Iter = InnerNode48Iter<<InnerNode48<K, V> as Node>::Key, <InnerNode48<K, V> as Node>::Value>

The type of the iterator over all children of the inner node
§

type ShrunkNode = InnerNodeCompressed<<InnerNode48<K, V> as Node>::Key, <InnerNode48<K, V> as Node>::Value, 16>

The type of the next smaller node type.
source§

fn lookup_child( &self, key_fragment: u8 ) -> Option<OpaqueNodePtr<<Self as Node>::Key, <Self as Node>::Value>>

Search through this node for a child node that corresponds to the given key fragment.
source§

fn write_child( &mut self, key_fragment: u8, child_pointer: OpaqueNodePtr<<Self as Node>::Key, <Self as Node>::Value> )

Write a child pointer with key fragment to this inner node. Read more
source§

fn remove_child( &mut self, key_fragment: u8 ) -> Option<OpaqueNodePtr<<Self as Node>::Key, <Self as Node>::Value>>

Attempt to remove a child pointer at the key fragment from this inner node. Read more
source§

fn grow(&self) -> Self::GrownNode

Grow this node into the next larger class, copying over children and prefix information.
source§

fn shrink(&self) -> Self::ShrunkNode

Shrink this node into the next smaller class, copying over children and prefix information. Read more
source§

fn header(&self) -> &Header

Access the header information for this node.
source§

fn header_mut(&mut self) -> &mut Header

Access the header information for this node.
source§

unsafe fn iter(&self) -> Self::Iter

Create an iterator over all (key bytes, child pointers) in this inner node. Read more
source§

fn split_at(&mut self, key_fragment: u8) -> Self

Split the inner node at the given key-byte, returning a new InnerNode of the same type that contains all children including and after the given key fragment. The original inner node has those children removed. Read more
source§

fn num_children_after_split(&self, key_fragment: u8) -> (usize, usize)

This function will count the number of children before and after the split point. Read more
source§

fn is_full(&self) -> bool

Returns true if this node has no more space to store children.
source§

impl<K, V> Node for InnerNode48<K, V>

§

type Key = K

The key type carried by the leafe nodes
§

type Value = V

The value type carried by the leaf nodes
source§

const TYPE: NodeType = NodeType::Node48

The runtime type of the node.
source§

impl<K, T> Visitable<K, T> for InnerNode48<K, T>

source§

fn super_visit_with<V: Visitor<K, T>>(&self, visitor: &mut V) -> V::Output

This function provides the default traversal behavior for the implementing type. Read more
source§

fn visit_with<V: Visitor<K, T>>(&self, visitor: &mut V) -> V::Output

This function will traverse the implementing type and execute any specific logic from the given Visitor. Read more
source§

impl<K, V> Sealed for InnerNode48<K, V>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<K, V> UnwindSafe for InnerNode48<K, V>where K: UnwindSafe, V: UnwindSafe,

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.