commit | e30085931ed5f9c39686769ad347c2f793c0175b | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Aug 25 07:55:46 2022 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Aug 25 07:55:46 2022 +0000 |
tree | 07a8c25eae5d1df12281632f3586a9e91b351362 | |
parent | eebf1bb3b860452dc8dd32704b1910453e8fcb0d [diff] | |
parent | 3d77d495b44f2395b5f88cbba0c11d7c4107b6ad [diff] |
Snap for 8992082 from 3d77d495b44f2395b5f88cbba0c11d7c4107b6ad to gki13-boot-release Change-Id: Ia252b7693977e60cb0ff1cdf84a6c5008a40d4cd
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.