commit | 3a9a7b89776d2d72fcd927f20859371b124cc0b5 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Mar 10 05:17:48 2023 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Mar 10 05:17:48 2023 +0000 |
tree | 7f08bb33b7d46ae8a14a9f02449fada34d5375b2 | |
parent | e73c802b53e31accc774a374b5e4b64e167d208e [diff] | |
parent | 37a9e1f4b134d9eff5c341099c2950ea7a5888b9 [diff] |
Snap for 9722771 from 37a9e1f4b134d9eff5c341099c2950ea7a5888b9 to udc-d1-release Change-Id: Ibfbc236251193071b7eb13c05b5092f6e429794d
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.