Module node

Source

Modulesยง

marker ๐Ÿ”’

Structsยง

BalancingContext ๐Ÿ”’
Represents a session for evaluating and performing a balancing operation around an internal key-value pair.
Handle ๐Ÿ”’
A reference to a specific key-value pair or edge within a node. The Node parameter must be a NodeRef, while the Type can either be KV (signifying a handle on a key-value pair) or Edge (signifying a handle on an edge).
InternalNode ๐Ÿ”’
The underlying representation of internal nodes. As with LeafNodes, these should be hidden behind BoxedNodes to prevent dropping uninitialized keys and values. Any pointer to an InternalNode can be directly cast to a pointer to the underlying LeafNode 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 of repr(C).
LeafNode ๐Ÿ”’
The underlying representation of leaf nodes and part of the representation of internal nodes.
NodeRef ๐Ÿ”’
A reference to a node.
SplitResult ๐Ÿ”’
Result of insertion, when a node needed to expand beyond its capacity.

Enumsยง

ForceResult ๐Ÿ”’
LeftOrRight ๐Ÿ”’

Constantsยง

B ๐Ÿ”’
CAPACITY ๐Ÿ”’
EDGE_IDX_LEFT_OF_CENTER ๐Ÿ”’
EDGE_IDX_RIGHT_OF_CENTER ๐Ÿ”’
KV_IDX_CENTER ๐Ÿ”’
MIN_LEN_AFTER_SPLIT ๐Ÿ”’

Functionsยง

move_to_slice ๐Ÿ”’
Moves all values from a slice of initialized elements to a slice of uninitialized elements, leaving behind src as all uninitialized. Works like dst.copy_from_slice(src) but does not require T to be Copy.
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.
splitpoint ๐Ÿ”’
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 Aliasesยง

BoxedNode ๐Ÿ”’
A managed, non-null pointer to a node. This is either an owned pointer to LeafNode<K, V> or an owned pointer to InternalNode<K, V>.
Root ๐Ÿ”’
The root node of an owned tree.