MCPcopy Index your code
hub / github.com/LPGhatguy/thunderdome

github.com/LPGhatguy/thunderdome @v0.6.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.6.1 ↗ · + Follow
104 symbols 298 edges 12 files 34 documented · 33%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Thunderdome

GitHub CI Status thunderdome on crates.io thunderdome docs

Thunderdome is a ~~gladitorial~~ generational arena inspired by generational-arena, slotmap, and slab. It provides constant time insertion, lookup, and removal via small (8 byte) keys returned from [Arena].

Thunderdome's key type, [Index], is still 8 bytes when put inside of an Option<T> thanks to Rust's NonZero* types.

Basic Examples

let mut arena = Arena::new();

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

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

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

let foo_value = arena.remove(foo);
assert_eq!(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>() 8 16 8 8
size_of::<Option<Index>>() 8 24 8 16
Max Elements 2³² 2⁶⁴ 2³² 2⁶⁴
Non-Copy Values Yes Yes Yes Yes
no_std Support Yes Yes Yes No
Serde Support No Yes Yes No
  • Sizes calculated on rustc 1.44.0-x86_64-pc-windows-msvc
  • See the Thunderdome comparison Cargo.toml for versions of each library tested.

  • Generational indices help solve the ABA Problem, which can cause dangling keys to mistakenly access newly-inserted data.

Minimum Supported Rust Version (MSRV)

Thunderdome supports Rust 1.47.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.

Crate Features

  • std (default): Use the standard library. Disable to make this crate no-std compatible.

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.

Core symbols most depended-on inside this repo

insert
called by 46
src/arena.rs
get_mut
called by 14
src/arena.rs
get
called by 11
src/arena.rs
len
called by 7
src/arena.rs
next
called by 7
src/generation.rs
iter
called by 6
src/arena.rs
get2_mut
called by 5
src/arena.rs
remove
called by 5
src/arena.rs

Shape

Method 54
Function 39
Class 10
Enum 1

Languages

Rust100%

Modules by API surface

src/arena.rs63 symbols
src/generation.rs8 symbols
src/free_pointer.rs6 symbols
src/iter/drain.rs5 symbols
comparison/src/main.rs5 symbols
benchmark/benches/primary.rs5 symbols
src/iter/iter_mut.rs4 symbols
src/iter/iter.rs4 symbols
src/iter/into_iter.rs4 symbols

For agents

$ claude mcp add thunderdome \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact