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:
- Incorporates a set value of
NodeType, accessible viaNode::TYPE. - Specifies where the inner node sits in the “growth order”, via
InnerNode::GrownNodeandInnerNode::ShrunkNode.
Required Associated Types§
Sourcetype GrownNode: InnerNode<PREFIX_LEN, Key = Self::Key, Value = Self::Value>
type GrownNode: InnerNode<PREFIX_LEN, Key = Self::Key, Value = Self::Value>
The type of the next larger node type.
Sourcetype ShrunkNode: InnerNode<PREFIX_LEN, Key = Self::Key, Value = Self::Value>
type ShrunkNode: InnerNode<PREFIX_LEN, Key = Self::Key, Value = Self::Value>
The type of the next smaller node type.
Required Methods§
Sourcefn grow(&self) -> Self::GrownNode
fn grow(&self) -> Self::GrownNode
Grow this node into the next larger class, copying over children and prefix information.
Sourcefn shrink(&self) -> Self::ShrunkNode
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§
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.