Thunderdome

GitHub CI Status thunderdome on crates.io thunderdome docs

Generational arena inspired by generational-arena, slotmap, and slab.

Basic Examples

```rust let mut arena = Arena::new();

let foo = arena.insert("Foo"); let bar = arena.insert("Bar");

asserteq!(arena[foo], "Foo"); asserteq!(arena[bar], "Bar");

arena[bar] = "Replaced"; assert_eq!(arena[bar], "Replaced");

let foovalue = arena.remove(foo); asserteq!(foo_value, Some("Foo"));

// The slot previously used by foo will be reused for baz let baz = arena.insert("Baz"); assert_eq!(arena[baz], "Baz");

// foo is no longer a valid key assert_eq!(arena.get(foo), None); ```

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 |

  1. slotmap's SlotMap and HopSlotMap require values to be Copy on stable Rust versions. slotmap's DenseSlotMap type supports non-Copy types on stable, but has different performance trade-offs.

Minimum Supported Rust Version (MSRV)

Thunderdome supports Rust 1.31.0 and newer. Until Thunderdome reaches 1.0, changes to the MSRV will require major version bumps. After 1.0, MSRV changes will only require minor version bumps, but will need significant justification.

License

Licensed under either of

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.