17 releases

new 0.4.10 Jun 15, 2025
0.4.9 Aug 22, 2023
0.4.8 Feb 19, 2023
0.4.7 Jul 19, 2022
0.1.2 Jul 23, 2015

#11 in Memory management

Download history 3103341/week @ 2025-02-28 3330487/week @ 2025-03-07 3388506/week @ 2025-03-14 3999489/week @ 2025-03-21 3215567/week @ 2025-03-28 3483021/week @ 2025-04-04 3236225/week @ 2025-04-11 3041750/week @ 2025-04-18 3098678/week @ 2025-04-25 3061279/week @ 2025-05-02 3171914/week @ 2025-05-09 3323968/week @ 2025-05-16 2922260/week @ 2025-05-23 3177626/week @ 2025-05-30 3267268/week @ 2025-06-06 3892947/week @ 2025-06-13

13,865,572 downloads per month
Used in 29,084 crates (464 directly)

MIT license

55KB
754 lines

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

~150KB