gecko-dev/third_party/rust/slab
Nathan Froyd b93bf873ba Bug 1502964 - part 2 - update winapi to froydnj/winapi-rs#aarch64; r=ted.mielczarek 2018-11-02 10:56:08 -04:00
..
src Bug 1484462 - Revendor Rust dependencies. r=ato 2018-08-23 13:15:36 +01:00
tests Bug 1484462 - Revendor Rust dependencies. r=ato 2018-08-23 13:15:36 +01:00
.cargo-checksum.json Bug 1502964 - part 2 - update winapi to froydnj/winapi-rs#aarch64; r=ted.mielczarek 2018-11-02 10:56:08 -04:00
CHANGELOG.md Bug 1484462 - Revendor Rust dependencies. r=ato 2018-08-23 13:15:36 +01:00
Cargo.toml Bug 1484462 - Revendor Rust dependencies. r=ato 2018-08-23 13:15:36 +01:00
LICENSE Bug 1484462 - Revendor Rust dependencies. r=ato 2018-08-23 13:15:36 +01:00
README.md Bug 1484462 - Revendor Rust dependencies. r=ato 2018-08-23 13:15:36 +01:00

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:

extern crate slab;

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.