16 releases

0.4.9 Aug 22, 2023
0.4.8 Feb 19, 2023
0.4.7 Jul 19, 2022
0.4.5 Oct 13, 2021
0.1.2 Jul 23, 2015

#10 in Memory management

Download history 2046764/week @ 2024-07-19 2053316/week @ 2024-07-26 2026944/week @ 2024-08-02 2147492/week @ 2024-08-09 2049512/week @ 2024-08-16 2122269/week @ 2024-08-23 2011694/week @ 2024-08-30 2131031/week @ 2024-09-06 1961019/week @ 2024-09-13 2294979/week @ 2024-09-20 2292490/week @ 2024-09-27 2789799/week @ 2024-10-04 2612273/week @ 2024-10-11 2761620/week @ 2024-10-18 2213864/week @ 2024-10-25 2140713/week @ 2024-11-01

10,171,163 downloads per month
Used in 25,796 crates (410 directly)

MIT license

54KB
734 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

~160KB