commit | e3ed216dff3e8c15d9f6b917e821e67fa65f0d95 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Dec 23 02:06:43 2021 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Thu Dec 23 02:06:43 2021 +0000 |
tree | 64d269b6a6b7178fef0d58a34e7b08e9004a21b0 | |
parent | db72060c2853200247ec2aa91b59d4e1f2c198d1 [diff] | |
parent | b2f38d110fa9baa5b82eceec486758f4e19d593f [diff] |
Snap for 8023588 from b2f38d110fa9baa5b82eceec486758f4e19d593f to tm-release Change-Id: Icafef5c1143d7fc95df2032f7c0d41a8582314df
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.