indextree 4.8.1

Arena based tree structure by using indices instead of reference counted pointers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use indextree::Arena;

pub fn main() {
    // Create a new arena
    let arena = &mut Arena::new();

    // Add some new nodes to the arena
    let a = arena.new_node(1);
    let b = arena.new_node(2);

    // Append b to a
    a.append(b, arena);
    assert_eq!(b.ancestors(arena).count(), 2);
}