commit | b4040a43ba1acb58a3cd5d2678934e20c7aa2f73 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Aug 13 03:06:04 2021 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Aug 13 03:06:04 2021 +0000 |
tree | d491e6133a10e7ac0f7aec3e5d2fe25cc87e92b7 | |
parent | aef7ef56943ea40ca67fd88fe41e71a5257bac2c [diff] | |
parent | dc3e744fd1c120eeecfd40613de3396c2f286625 [diff] |
Snap for 7637695 from dc3e744fd1c120eeecfd40613de3396c2f286625 to tm-release Change-Id: I9db63aca60455b9dc9822de2029ae460c0d40f01
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.