| commit | c1670736d295e8b7dae65de0b2bb3edea9eca421 | [log] [tgz] |
|---|---|---|
| author | android-build-team Robot <[email protected]> | Fri Apr 30 01:06:26 2021 +0000 |
| committer | android-build-team Robot <[email protected]> | Fri Apr 30 01:06:26 2021 +0000 |
| tree | 95d23281f1be722c5e7ff14d322b70b0a5120db1 | |
| parent | 531b9f434f4b62826cd391de351bc820e56dbb46 [diff] | |
| parent | 7ff3771e08c8986974cba124dcccb529c8f78fc9 [diff] |
Snap for 7325276 from 7ff3771e08c8986974cba124dcccb529c8f78fc9 to sc-v2-release Change-Id: I133986b7aa7dc17fba72bd00d47dfc6efb20251b
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.