Skip to main content

Crate neco_tree

Crate neco_tree 

Source
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 unique u64 id and a user-defined value of type T. An internal HashMap index makes id-based lookup O(1).
  • CursoredTree<T> wraps a Tree<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§

CursoredTree
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.
ParentNotFound
Error returned by Tree::push_child when the specified parent id does not exist in the tree.
Tree
Rooted multi-way tree with O(1) id lookup.

Enums§

PrunePolicy
Policy for Tree::prune.