Thunderdome
Generational arena inspired by generational-arena, slotmap, and slab.
Thunderdome should probably not (yet) be used in real projects. It is severely under-tested and contains a small amount of unsafe code.
Basic Examples
let mut arena = new;
let foo = arena.insert;
let bar = arena.insert;
assert_eq!;
assert_eq!;
arena = "Replaced";
assert_eq!;
let foo_value = arena.remove;
assert_eq!;
// The slot previously used by foo will be reused for baz
let baz = arena.insert;
assert_eq!;
// foo is no longer a valid key
assert_eq!;
Comparison With Similar Crates
Feature | Thunderdome | generational-arena | slotmap | slab |
---|---|---|---|---|
Generational Indices | Yes | Yes | Yes | No |
size_of::<Index>() |
16 | 16 | 8 | 8 |
size_of::<Option<Index>>() |
16 | 24 | 8 | 16 |
Non-Copy Values |
Yes | Yes | Sorta¹ | Yes |
no-std support | No | Yes | No | No |
Serde support | No | Yes | Yes | No |
Should be used | No | Yes | Yes | Yes |
- Sizes calculated on rustc
1.44.0-x86_64-pc-windows-msvc
- slotmap's
SlotMap
andHopSlotMap
require values to beCopy
on stable Rust versions. slotmap'sDenseSlotMap
type supports non-Copy
types on stable, but has different performance trade-offs.
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.