logos.std.data.persistent.bt.iter
Module std · package logos-std
Types
structBtIter
struct BtIter
Forward (or reverse-opened) snapshot iterator over a persistent BTree.
leaf_arc is null iff the iter is exhausted; leaf_p is the typed view derived from it.
Fields
cursor: u64
Index of the current entry within the leaf.
leaf_arc: Arc<dyn BTreeNode>
Owns an rc share of the current leaf block, pinning it for the iter’s lifetime.
leaf_p: *mut LeafNode<K, V, STORE_CFG, CFG>
Typed-pointer view of the current leaf; null iff the iter is exhausted/invalid.
path: Vec<IterFrame<K, STORE_CFG, CFG>>
Branch frames from root to the current leaf’s parent.
structIterFrame
struct IterFrame
Records one step of a BtIter descent: a pinned branch node plus the child index whose
subtree the iterator currently occupies.
Fields
branch_arc: Arc<dyn BTreeNode>
Owns an rc share of the branch block, pinning it for the frame’s lifetime.
branch_p: *mut BranchNode<K, STORE_CFG, CFG>
Typed-pointer view of the branch, derived from branch_arc’s data pointer.
idx: u64
Child index within the branch whose subtree the iterator currently occupies.
Functions
fnbt_iter_open
fn bt_iter_open(arc: &Arc<dyn BTreeNode>) -> BtIter<K, V, STORE_CFG, CFG>
Opens a forward iter at the leftmost (smallest) entry of the BTree rooted at arc.
fnbt_iter_open_at
fn bt_iter_open_at(arc: &Arc<dyn BTreeNode>, n: u64) -> BtIter<K, V, STORE_CFG, CFG>
Opens a forward iter positioned at the n-th entry (0-based) in sorted order.
Returns an invalid iter (valid()==false) when n >= total size of the tree.
fnbt_iter_open_back
fn bt_iter_open_back(arc: &Arc<dyn BTreeNode>) -> BtIter<K, V, STORE_CFG, CFG>
Opens a reverse iter at the rightmost (largest) entry of the BTree rooted at arc.
Walk backward with step_back(); an empty tree yields an invalid iter (valid()==false).