Module grapes::tree

source · []
Expand description

Persistent Tree & related items

A Tree (a well-known data structure!) is a set of items organized in a hierarchy. Tree always has at least one item, the root node. The root node may have children nodes, and those nodes may have children of their own – this goes down as deep as you need!

Every node has exactly one parent, except for the root node, which has no parent.

A node’s children is logically a list – so the Tree keeps track of the order of the children, and you can change it if you want.

Every node has an NodeId – you can directly retrieve a node if you know its ID.

Structs

An error that occurs when attempting to remove the root node from a Tree

An iterator over the children of a node

The ID of a node in a Tree

A mutable reference to a node in a Tree

A reference to a node in a Tree

Error: the root node cannot have siblings

A persistent, indexable, hierarchical data structure

Enums

An error that occurs when attempting to insert a node in an invalid location

Describes a location in a tree

An error that occurs when attempting to move a node to an invalid location