commit | 871773ad65099c76e195f2b8d65c01e48e9acd96 | [log] [tgz] |
---|---|---|
author | James Farrell <jamesfarrell@google.com> | Thu Aug 29 16:49:56 2024 +0000 |
committer | James Farrell <jamesfarrell@google.com> | Thu Aug 29 16:49:56 2024 +0000 |
tree | f9bcea21f351250c3f36822b29198065f7341234 | |
parent | f7618c7eae01eccb7b9ab9186bf8dfdde149683e [diff] |
Migrate 25 crates to monorepo. sec1 semver serde_cbor serde_derive shared_library slab smallvec smccc socket2 spin spki strsim strum strum_macros sync_wrapper syn-mid synstructure tempfile termcolor termtree textwrap thiserror thread_local tinytemplate tokio-macros Bug: 339424309 Test: treehugger Change-Id: I5f1e9a1d906b3138d2df1410798e3bcb67f95f0f
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.