| commit | affccc738292af8fa6f873eaa981f9dcfa00876c | [log] [tgz] |
|---|---|---|
| author | Android Build Coastguard Worker <[email protected]> | Thu May 23 23:15:12 2024 +0000 |
| committer | Android Build Coastguard Worker <[email protected]> | Thu May 23 23:15:12 2024 +0000 |
| tree | 948bac536f7a9f37b3eefffef84a695427c4c12e | |
| parent | da6d1d0f95ddf7d29434dfe630eee819309f2277 [diff] | |
| parent | c5ab0b052fa9e8bebae3704da39a0e262a703211 [diff] |
Snap for 11881322 from c5ab0b052fa9e8bebae3704da39a0e262a703211 to 24Q3-release Change-Id: I9b962627fd34d3767741e1b565247e9faabd524d
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.