| commit | b2491d24cebcce3f0a5b450e72c0ffdf65c63aa8 | [log] [tgz] |
|---|---|---|
| author | Android Build Coastguard Worker <[email protected]> | Tue Sep 10 23:12:51 2024 +0000 |
| committer | Android Build Coastguard Worker <[email protected]> | Tue Sep 10 23:12:51 2024 +0000 |
| tree | f9bcea21f351250c3f36822b29198065f7341234 | |
| parent | c1b6d703ae1fa6da0e7f934c348ae34a2d375d63 [diff] | |
| parent | 6cf82263e138b713a241930bb675df94d67eb087 [diff] |
Snap for 12349386 from 6cf82263e138b713a241930bb675df94d67eb087 to sdk-release Change-Id: I0f8f12e13cfbf1ee6e1625d305a80cc9bddeed78
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.