Module cl_structures::tree

source ·
Expand description

An insert-only unordered tree, backed by a Vec

§Examples

use cl_structures::tree::{Tree, Node};
// A tree can be created
let mut tree = Tree::new();
// Provided with a root node
let root = tree.root("This is the root node").unwrap();

// Nodes can be accessed by indexing
assert_eq!(*tree[root].as_ref(), "This is the root node");
// Nodes' data can be accessed directly by calling `get`/`get_mut`
assert_eq!(tree.get(root).unwrap(), &"This is the root node")

Re-exports§

  • pub use self::tree_ref::Ref;

Modules§

Structs§