commit | d78ba363fe21106c7616e908fb92789528137958 | [log] [tgz] |
---|---|---|
author | Xin Li <delphij@google.com> | Sat Aug 14 06:42:22 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Sat Aug 14 06:42:22 2021 +0000 |
tree | d491e6133a10e7ac0f7aec3e5d2fe25cc87e92b7 | |
parent | d4b7f411240df78559c0ddf0ec37c3262337e0e0 [diff] | |
parent | 957e05e6e4a996d5edf4d8b81e00f30811bea058 [diff] |
[automerger skipped] Mark sc-dev-plus-aosp-without-vendor@7634622 as merged am: 76e39ba585 -s ours am: 957e05e6e4 -s ours am skip reason: Merged-In Ieca2d527db61e24c01f70b1a1133be0b6da139ed with SHA-1 31fb06ec29 is already in history Original change: https://googleplex-android-review.googlesource.com/c/platform/external/rust/crates/slab/+/15570660 Change-Id: If4bdd32bd14261a757364f2131dfecc5fb95fbac
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.