commit | ebb18812f868618e183d2c58e43b1de3bf0a9c13 | [log] [tgz] |
---|---|---|
author | Jason Macnak <natsu@google.com> | Thu Mar 19 21:16:56 2020 +0000 |
committer | Jason Macnak <natsu@google.com> | Mon Apr 06 10:28:30 2020 -0700 |
tree | a9ea99a3c6cf9117d3842b0abbbeb9f26acbefa4 | |
parent | 47302c2131156b31d7c6d8a9d5dbd9e79b92d613 [diff] |
Import 'slab' rust crate version 0.4.2 Bug: b/151760391 Test: m crosvm.experimental Change-Id: Ifdc5a0fdd0b226050d45ea80a6e60d9295e65ba1
Pre-allocated storage for a uniform data type.
To use slab
, first add this to your Cargo.toml
:
[dependencies] slab = "0.4.2"
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.
This project is licensed under the MIT license.
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.