spruce/tree
Pure nested tree rendering.
Trees are data structures rendered with an explicit Spruce context. The
default renderer uses Unicode branch glyphs when color is supported and a
deterministic ASCII fallback when it is not.
Types
Values
pub fn ascii(tree: Tree) -> Tree
Force deterministic ASCII branch markers regardless of color support.
pub fn child(parent: Tree, child child: Tree) -> Tree
Add a child to parent, preserving insertion order.
pub fn enumerator(
tree: Tree,
branch: fn(Int, Bool) -> String,
) -> Tree
Set a custom branch enumerator for the rendered tree.
The function receives the one-based depth of the node being rendered and whether it is the last child of its parent. It should return the complete branch marker to place before that node’s first label line.