tree: 27cb5f8a78efbeb7d18afc2561af2cf7a5d50157 [path history] [tgz]
  1. examples/
  2. src/
  3. tests/
  4. .cargo-checksum.json
  5. Cargo.lock
  6. Cargo.toml
  7. CHANGELOG.md
  8. LICENSE-APACHE
  9. LICENSE-MIT
  10. README.md
third_party/rust_crates/vendor/vec-arena/README.md

vec-arena

Build Status License Cargo Documentation

What is this?

A simple object arena.

You want to build a doubly linked list? Or maybe a bidirectional tree? Perhaps an even more complicated object graph?

Managing ownership and lifetimes might be tough then. Your options boil down to:

  1. Use unsafe code to escape Rust's ownership rules.
  2. Wrap every object in Rc<RefCell<T>>.
  3. Use Vec<T> to store objects, then access them using indices.

If the last option seems most appealing to you, perhaps Arena<T> is for you. It will provide a more convenient API than a plain Vec<T>.

Examples

Some data structures built using Arena<T>: