You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Taiki Endo ebc092e554
Merge pull request #18 from smol-rs/deprecated
2 years ago
.github/workflows Migrate CI to GitHub Actions 2 years ago
examples Bump to 0.5.0, delete unsafe, use 2018 edition 3 years ago
src Deprecate in favor of slab 2 years ago
tests Bump to 0.5.0, delete unsafe, use 2018 edition 3 years ago
.gitignore Rough initial design 7 years ago
CHANGELOG.md Deprecate in favor of slab 2 years ago
Cargo.toml Deprecate in favor of slab 2 years ago
LICENSE-APACHE Change to dual Apache-2.0/MIT 7 years ago
LICENSE-MIT Change to dual Apache-2.0/MIT 7 years ago
README.md Deprecate in favor of slab 2 years ago

README.md

vec-arena (deprecated)

Build License Cargo Documentation

This crate is now deprecated in favor of slab.

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>: