gecko-dev/third_party/rust/slab
Mike Hommey 309ed8ae59 Bug 1769901 - Update numerous rust crates. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D146660
2022-05-18 23:59:49 +00:00
..
src Bug 1769901 - Update numerous rust crates. r=emilio 2022-05-18 23:59:49 +00:00
tests
.cargo-checksum.json Bug 1769901 - Update numerous rust crates. r=emilio 2022-05-18 23:59:49 +00:00
CHANGELOG.md Bug 1769901 - Update numerous rust crates. r=emilio 2022-05-18 23:59:49 +00:00
Cargo.toml Bug 1769901 - Update numerous rust crates. r=emilio 2022-05-18 23:59:49 +00:00
LICENSE
README.md

README.md

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.