Crates.io | vec-arena |
lib.rs | vec-arena |
version | 1.2.0 |
source | src |
created_at | 2016-11-14 23:26:10.272717 |
updated_at | 2021-05-08 21:40:01.805732 |
description | A simple object arena |
homepage | |
repository | https://github.com/smol-rs/vec-arena |
max_upload_size | |
id | 7253 |
size | 49,338 |
This crate is now deprecated in favor of slab.
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:
Rc<RefCell<T>>
.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>
.
Some data structures built using Arena<T>
: