commit | 177ad4b2a137dce309c4a82fbb228825d4d62633 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Wed Jun 23 03:05:58 2021 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Wed Jun 23 03:05:58 2021 +0000 |
tree | e15fe45d4e6fb5f8b1df21c0137acbb9390fd036 | |
parent | 1cfa420e7fef0d8b772fa01a4e80ca4d49021579 [diff] | |
parent | b5c7cbc627fcac14a30fafdd55cd4a41aff9214b [diff] |
Snap for 7482983 from b5c7cbc627fcac14a30fafdd55cd4a41aff9214b to tm-release Change-Id: I7a6c137ad3eeb1d3bf7ca33421f3872c4369873b
Pre-allocated storage for a uniform data type.
To use slab
, first add this to your Cargo.toml
:
[dependencies] slab = "0.4.3"
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.