commit | b91d4e583a4eda37a19af4ce6074d49196aa2baf | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Jul 07 05:00:41 2023 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Jul 07 05:00:41 2023 +0000 |
tree | 7f08bb33b7d46ae8a14a9f02449fada34d5375b2 | |
parent | bd152b3ee973aefe5b1c5bcfc6295d2346c427ca [diff] | |
parent | 52a25c5a6a55a55b1fb617cfd856988d4ccee621 [diff] |
Snap for 10453563 from 52a25c5a6a55a55b1fb617cfd856988d4ccee621 to mainline-extservices-release Change-Id: I8a7bff0fceb94863eca20611ea1695f5a0d74e28
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.