commit | 0a7a6d9f18fd7296da3f742c9df91e08980782e6 | [log] [tgz] |
---|---|---|
author | Xin Li <delphij@google.com> | Sat Feb 20 00:24:23 2021 -0800 |
committer | Xin Li <delphij@google.com> | Sat Feb 20 00:24:23 2021 -0800 |
tree | e72c75b0dcb032e797acd754627d443269ba5076 | |
parent | e1225f23370d0776d004a14929cbbe5331e6994f [diff] | |
parent | ddfb6275aa650ad251fd8a89f0d2e19ed58f6b8f [diff] |
Mark ab/7061308 as merged in stage. Bug: 180401296 Merged-In: Ib01b876d3c5f64c0634602fcf596ff5fc5b659f3 Change-Id: Iaf80b5ae10e1f6da07dd285dc2206f290e252629
Pre-allocated storage for a uniform data type.
To use slab
, first add this to your Cargo.toml
:
[dependencies] slab = "0.4.2"
Next, add this to your crate:
extern crate slab; 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.