Slab allocator for Rust
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-04-06 15:20:01 +02:00
src chore: sync dependencies (monorepo) 2026-03-31 20:24:35 +02:00
tests Fix get_disjoint_mut error condition (#152) 2025-08-08 09:25:07 +02:00
.gitignore Remove .swp file 2016-01-18 10:25:42 -08:00
Cargo.toml chore: sync dependencies (monorepo) 2026-04-06 15:20:01 +02:00
LICENSE Bump version to v0.4.2 2019-01-11 15:08:54 -08:00
README.md Fix CI badge (#127) 2022-12-17 16:03:47 +09:00

Slab

Pre-allocated storage for a uniform data type.

Crates.io Build Status

Documentation

Usage

To use slab, first add this to your Cargo.toml:

[dependencies]
slab = "0.4"

Next, add this to your crate:

use slab::Slab;

let mut slab = Slab::new();

let hello = slab.insert("hello");
let world = slab.insert("world");

assert_eq!(slab[hello], "hello");
assert_eq!(slab[world], "world");

slab[world] = "earth";
assert_eq!(slab[world], "earth");

See documentation for more details.

License

This project is licensed under the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in slab by you, shall be licensed as MIT, without any additional terms or conditions.