commit | cdc236f96fafc37786c09d0afe741a3727acbe5b | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu May 23 15:44:00 2024 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu May 23 15:44:00 2024 +0000 |
tree | 948bac536f7a9f37b3eefffef84a695427c4c12e | |
parent | c93f0b297fe21b87db5578d7b6eaaff15640dc6a [diff] | |
parent | 91a008d6fd7fa5a0c65967d138807a6abe36baed [diff] |
Snap for 11880863 from 91a008d6fd7fa5a0c65967d138807a6abe36baed to build-tools-release Change-Id: I8055a1287a3b84d9677ea02df2d8d0f0b2b8be2d
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.