commit | 52a25c5a6a55a55b1fb617cfd856988d4ccee621 | [log] [tgz] |
---|---|---|
author | Matthew Maurer <mmaurer@google.com> | Thu Mar 09 18:06:54 2023 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Thu Mar 09 18:06:54 2023 +0000 |
tree | 7f08bb33b7d46ae8a14a9f02449fada34d5375b2 | |
parent | cbeea3467f61cb921ff5e0e2c47fba5d9a8132a5 [diff] | |
parent | b4d6ef52b3455146bc03e8291ce4859cc1ec8d42 [diff] |
Merge "Make slab available to product and vendor" am: 61af609cca am: 64fcafb704 am: 37a29094c1 am: b4d6ef52b3 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/2475717 Change-Id: Ic2a8d8794f4c6189af06d2ffdeabde088b4be2f7 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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.