commit | c4dc3da5a351af530ed5d8cc4fefaaa50892b3c8 | [log] [tgz] |
---|---|---|
author | Treehugger Robot <treehugger-gerrit@google.com> | Tue Jun 22 10:17:21 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Tue Jun 22 10:17:21 2021 +0000 |
tree | e15fe45d4e6fb5f8b1df21c0137acbb9390fd036 | |
parent | 2a4ca8c887304a665012e582e517302a263fc27a [diff] | |
parent | 14f54f03442c67a31cb69901f5426c8aa116dd8f [diff] |
Merge "Make libslab available to DnsResolver" am: 14f54f0344 Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/slab/+/1741280 Change-Id: I05ef5309ef82f17c00214af070b8def915537242
Pre-allocated storage for a uniform data type.
To use slab
, first add this to your Cargo.toml
:
[dependencies] slab = "0.4.3"
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.