commit | d35b59f17af4d51c2aa291687154a52ee2d3b451 | [log] [tgz] |
---|---|---|
author | android-build-team Robot <android-build-team-robot@google.com> | Sun Feb 21 00:05:40 2021 +0000 |
committer | android-build-team Robot <android-build-team-robot@google.com> | Sun Feb 21 00:05:40 2021 +0000 |
tree | e72c75b0dcb032e797acd754627d443269ba5076 | |
parent | 77d9a67b4f3f9f00374d50646312b36969342098 [diff] | |
parent | 83e5189fc731afa9951736802f2d3ece7f06327c [diff] |
Snap for 7160059 from 83e5189fc731afa9951736802f2d3ece7f06327c to sc-d1-release Change-Id: I7ec84f3d33a997fdf6057fa6f38956697a8f68c2
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.