Module alloc::collections::btree::node
source · Modules
Structs
- Represents a session for evaluating and performing a balancing operation around an internal key-value pair.
- A reference to a specific key-value pair or edge within a node. The
Node
parameter must be aNodeRef
, while theType
can either beKV
(signifying a handle on a key-value pair) orEdge
(signifying a handle on an edge). - The underlying representation of internal nodes. As with
LeafNode
s, these should be hidden behindBoxedNode
s to prevent dropping uninitialized keys and values. Any pointer to anInternalNode
can be directly cast to a pointer to the underlyingLeafNode
portion of the node, allowing code to act on leaf and internal nodes generically without having to even check which of the two a pointer is pointing at. This property is enabled by the use ofrepr(C)
. - LeafNode 🔒The underlying representation of leaf nodes and part of the representation of internal nodes.
- A reference to a node.
- Result of insertion, when a node needed to expand beyond its capacity.
Enums
Constants
- B 🔒
Functions
- Moves all values from a slice of initialized elements to a slice of uninitialized elements, leaving behind
src
as all uninitialized. Works likedst.copy_from_slice(src)
but does not requireT
to beCopy
. - slice_insert 🔒 ⚠Inserts a value into a slice of initialized elements followed by one uninitialized element.
- slice_remove 🔒 ⚠Removes and returns a value from a slice of all initialized elements, leaving behind one trailing uninitialized element.
- slice_shl 🔒 ⚠Shifts the elements in a slice
distance
positions to the left. - slice_shr 🔒 ⚠Shifts the elements in a slice
distance
positions to the right. - Given an edge index where we want to insert into a node filled to capacity, computes a sensible KV index of a split point and where to perform the insertion. The goal of the split point is for its key and value to end up in a parent node; the keys, values and edges to the left of the split point become the left child; the keys, values and edges to the right of the split point become the right child.
Type Definitions
- A managed, non-null pointer to a node. This is either an owned pointer to
LeafNode<K, V>
or an owned pointer toInternalNode<K, V>
. - The root node of an owned tree.