Expand description
Included from https://github.com/SimonSapin/rust-forest/blob/5783c8be8680b84c0438638bdee07d4e4aca40ac/arena-tree/lib.rs. MIT license (per Cargo.toml).
A DOM-like tree data structure based on &Node
references.
Any non-trivial tree involves reference cycles
(e.g. if a node has a first child, the parent of the child is that node).
To enable this, nodes need to live in an arena allocator
such as arena::TypedArena
distributed with rustc (which is #[unstable]
as of this writing)
or typed_arena::Arena
.
If you need mutability in the node’s data
,
make it a cell (Cell
or RefCell
) or use cells inside of it.
Structs§
- An iterator of references to the ancestors a given node.
- An iterator of references to the children of a given node.
- An iterator of references to a given node and its descendants, in tree order.
- An iterator of references to the siblings after a given node.
- A node inside a DOM-like tree.
- An iterator of references to the siblings before a given node.
- An iterator of references to the children of a given node, in reverse order.
- An iterator of the start and end edges of a given node and its descendants, in reverse tree order.
- An iterator of the start and end edges of a given node and its descendants, in tree order.
Enums§
- An edge of the node graph returned by a traversal iterator.