commit | a38073f9edccd6bd036ad615c79cea7042bb0dbe | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Mon Mar 14 07:04:51 2022 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Mon Mar 14 07:04:51 2022 +0000 |
tree | 619b140d4e933acdbc6d87f524856c1a682011ad | |
parent | c5ec3f981d818d8b2ed7ed633be76d92af69159d [diff] | |
parent | b54de970eb3a80b64222362b7e35e8d0ecde7848 [diff] |
Snap for 8294919 from b54de970eb3a80b64222362b7e35e8d0ecde7848 to main-cg-testing-release Change-Id: I6778684c5a89e29f4d0a8e63c8476c7a923f71bc
Pre-allocated storage for a uniform data type.
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.
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.