Skip to main content

Module node

Module node 

Source
Expand description

Tree node algebraic type and packed NodeRef reference.

NodeRef packs an internal-vs-leaf discriminator and a slot index into a single u32. The high bit (1 << 31) marks leaves; the low 31 bits hold the slot index in the corresponding storage arena owned by NodeStore.

Structs§

InternalData
Raw internal-node record. Lives inline in the crate::NodeStore internal arena — one entry per live internal node. The bounding box is embedded inline so tree traversal stays cache-resident.
LeafData
Raw leaf-node record. Lives inline in the crate::NodeStore leaf arena — one entry per live leaf. Kept small (no bounding box, no cut) so the leaf arena fits many entries per cache line. Before the v4 split the leaf arena stored the full Node<D> enum with its internal-variant shape, wasting ~300 bytes per leaf at D = 16.
NodeRef
Packed reference to a tree node.

Enums§

NodeView
Zero-copy immutable view of a tree node. Returned by crate::NodeStore::view — pattern-match to branch on internal-vs-leaf without cloning the underlying record.
NodeViewMut
Zero-copy mutable view of a tree node. Mirrors NodeView but hands out &mut references for in-place field updates.