commit | 5169926fb9a24ae061a15f06d1c2e01264c684fb | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Feb 02 23:55:30 2024 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Feb 02 23:55:30 2024 +0000 |
tree | e351dd4f83e1b4d4015bf825c853a871836e47dd | |
parent | 21da4386b2d3477873fe08b585b8636e39c86ce8 [diff] | |
parent | 4347594c5e6d984d16f0c9f9b8e0f20ce638a316 [diff] |
Snap for 11400057 from 4347594c5e6d984d16f0c9f9b8e0f20ce638a316 to simpleperf-release Change-Id: I3b1cbacd929a73e9049d3f2adb0973b210d1e091
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.