This arena tree structure is using just a single Vec
and numerical identifiers (indices in the vector) instead of
reference counted pointers like. This means there is no RefCell
and mutability is handled in a way much more
idiomatic to Rust through unique (&mut) access to the arena. The tree can be sent or shared across threads like a Vec
.
This enables general multiprocessing support like parallel tree traversals.
```rust use indextree::Arena;
// Create a new arena let arena = &mut Arena::new();
// Add some new nodes to the arena let a = arena.newnode(1); let b = arena.newnode(2);
// Append a to b a.append(b, arena); asserteq!(b.ancestors(arena).intoiter().count(), 2); ```