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

#3 in Memory management

Download history 844152/week @ 2023-12-23 1243787/week @ 2023-12-30 1565302/week @ 2024-01-06 1623461/week @ 2024-01-13 1696480/week @ 2024-01-20 1857686/week @ 2024-01-27 1810786/week @ 2024-02-03 1805187/week @ 2024-02-10 1826018/week @ 2024-02-17 1906764/week @ 2024-02-24 1909507/week @ 2024-03-02 1814825/week @ 2024-03-09 1818726/week @ 2024-03-16 1832637/week @ 2024-03-23 1840190/week @ 2024-03-30 1537676/week @ 2024-04-06

7,321,900 downloads per month
Used in 23,788 crates (372 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

~185KB