commit | a0cf60ca902fcc82a5a44da078ad474fa174888f | [log] [tgz] |
---|---|---|
author | android-build-team Robot <android-build-team-robot@google.com> | Thu Jun 03 03:05:44 2021 +0000 |
committer | android-build-team Robot <android-build-team-robot@google.com> | Thu Jun 03 03:05:44 2021 +0000 |
tree | 95d23281f1be722c5e7ff14d322b70b0a5120db1 | |
parent | ba2d4d1a22577f340bb2bef666b725a5af42cb88 [diff] | |
parent | e150d913b5eaaa59e3e1fa87d2ec3d64de16f19b [diff] |
Snap for 7418644 from e150d913b5eaaa59e3e1fa87d2ec3d64de16f19b to tm-release Change-Id: I24494b003aa34990679b6b5ff455e6de75ef2dbc
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.