Go to file
Taiki Endo ebc092e554
Merge pull request #18 from smol-rs/deprecated
Deprecate in favor of slab
2021-05-09 06:37:33 +09:00
.github/workflows Migrate CI to GitHub Actions 2021-03-20 16:21:49 +09:00
examples Bump to 0.5.0, delete unsafe, use 2018 edition 2020-07-07 09:35:12 +02:00
src Deprecate in favor of slab 2021-04-25 21:44:30 +09:00
tests Bump to 0.5.0, delete unsafe, use 2018 edition 2020-07-07 09:35:12 +02:00
.gitignore Rough initial design 2016-10-23 14:58:49 +02:00
CHANGELOG.md Deprecate in favor of slab 2021-04-25 21:44:30 +09:00
Cargo.toml Deprecate in favor of slab 2021-04-25 21:44:30 +09:00
LICENSE-APACHE Change to dual Apache-2.0/MIT 2016-10-25 18:54:42 +02:00
LICENSE-MIT Change to dual Apache-2.0/MIT 2016-10-25 18:54:42 +02:00
README.md Deprecate in favor of slab 2021-04-25 21:44:30 +09:00

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