InnerNode

Trait InnerNode 

Source
pub trait InnerNode<const PREFIX_LEN: usize>:
    Node<PREFIX_LEN>
    + Sized
    + Debug
    + InnerNodeCommon<Self::Key, Self::Value, PREFIX_LEN> {
    type GrownNode: InnerNode<PREFIX_LEN, Key = Self::Key, Value = Self::Value>;
    type ShrunkNode: InnerNode<PREFIX_LEN, Key = Self::Key, Value = Self::Value>;

    // Required methods
    fn grow(&self) -> Self::GrownNode;
    fn shrink(&self) -> Self::ShrunkNode;

    // Provided method
    fn is_full(&self) -> bool { ... }
}
Expand description

Common methods implemented by all inner nodes that will be used in the tree.

To contrast with InnerNodeCommon, this trait:

Required Associated Types§

Source

type GrownNode: InnerNode<PREFIX_LEN, Key = Self::Key, Value = Self::Value>

The type of the next larger node type.

Source

type ShrunkNode: InnerNode<PREFIX_LEN, Key = Self::Key, Value = Self::Value>

The type of the next smaller node type.

Required Methods§

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.

§Panics
  • Panics if the new, smaller node size does not have enough capacity to hold all the children.

Provided Methods§

Source

fn is_full(&self) -> bool

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<K, V, const PREFIX_LEN: usize> InnerNode<PREFIX_LEN> for InnerNodeDirect<K, V, PREFIX_LEN>

Source§

type GrownNode = InnerNodeDirect<K, V, PREFIX_LEN>

Source§

type ShrunkNode = InnerNodeIndirect<K, V, PREFIX_LEN, 48>

Source§

impl<K, V, const PREFIX_LEN: usize> InnerNode<PREFIX_LEN> for InnerNode4<K, V, PREFIX_LEN>

Source§

type GrownNode = InnerNodeSorted<K, V, PREFIX_LEN, 16>

Source§

type ShrunkNode = InnerNodeSorted<K, V, PREFIX_LEN, 4>

Source§

impl<K, V, const PREFIX_LEN: usize> InnerNode<PREFIX_LEN> for InnerNode16<K, V, PREFIX_LEN>

Source§

type GrownNode = InnerNodeIndirect<K, V, PREFIX_LEN, 48>

Source§

type ShrunkNode = InnerNodeSorted<K, V, PREFIX_LEN, 4>

Source§

impl<K, V, const PREFIX_LEN: usize> InnerNode<PREFIX_LEN> for InnerNode48<K, V, PREFIX_LEN>

Source§

type GrownNode = InnerNodeDirect<K, V, PREFIX_LEN>

Source§

type ShrunkNode = InnerNodeSorted<K, V, PREFIX_LEN, 16>