Sunbeam Studios

Our open-source projects, here for you!

slab (0.4.12)

Published 2026-03-26 11:03:45 +00:00 by siennathesane

Installation

[registry]
default = "gitea"

[registries.gitea]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add slab@0.4.12

About this package

Pre-allocated storage for a uniform data type

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.

Dependencies

ID Version
serde ^1.0.95
serde ^1
serde_test ^1

Keywords

slab allocator no_std
Details
Cargo
2026-03-26 11:03:45 +00:00
0
Carl Lerche <me@carllerche.com>
MIT
18 KiB
Assets (1)
Versions (1) View all
0.4.12 2026-03-26