commit | fc86b23c75580dcf80077184bcabcb72742fff66 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Feb 08 01:22:40 2024 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Feb 08 01:22:40 2024 +0000 |
tree | c1ff49d9f891c42704a17d7486b034dbed218e1a | |
parent | 5169926fb9a24ae061a15f06d1c2e01264c684fb [diff] | |
parent | f4a1151ee3613c367a52e8c4ba02ce90c2cd0678 [diff] |
Snap for 11421525 from f4a1151ee3613c367a52e8c4ba02ce90c2cd0678 to simpleperf-release Change-Id: Icb3a1f398e0d221e5b8d28c600541b84f3cb6abe
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.