Expand description
Generic ID-bearing tree with cursor-based navigation.
This crate provides two main types:
Tree<T>stores a rooted multi-way tree where every node carries a uniqueu64id and a user-defined value of typeT. An internalHashMapindex makes id-based lookup O(1).CursoredTree<T>wraps aTree<T>and tracks a current position via an index path from the root. Navigation helpers (go_parent,go_child,push, …) update the cursor atomically.
Pruning, subtree removal, DFS iteration, and flat-list conversion are available on both types.
Structs§
- Cursored
Tree - Tree with a movable cursor that tracks the current position.
- DfsIter
- Depth-first iterator over
(depth, &Node<T>)pairs. - Node
- Single node in the tree.
- Parent
NotFound - Error returned by
Tree::push_childwhen the specified parent id does not exist in the tree. - Tree
- Rooted multi-way tree with O(1) id lookup.
Enums§
- Prune
Policy - Policy for
Tree::prune.