Crates.io | hashbrown |
lib.rs | hashbrown |
version | |
source | src |
created_at | 2018-10-29 14:28:15.767024 |
updated_at | 2024-11-25 00:36:20.789854 |
description | A Rust port of Google's SwissTable hash map |
homepage | |
repository | https://github.com/rust-lang/hashbrown |
max_upload_size | |
id | 93342 |
Cargo.toml error: | TOML parse error at line 23, column 1 | 23 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
This crate is a Rust port of Google's high-performance SwissTable hash
map, adapted to make it a drop-in replacement for Rust's standard HashMap
and HashSet
types.
The original C++ version of SwissTable can be found here, and this CppCon talk gives an overview of how the algorithm works.
Since Rust 1.36, this is now the HashMap
implementation for the Rust standard
library. However you may still want to use this crate instead since it works
in environments without std
, such as embedded systems and kernels.
HashMap
and HashSet
types.HashMap
.#[no_std]
(but requires a global allocator with the alloc
crate).Add this to your Cargo.toml
:
[dependencies]
hashbrown = "0.15"
Then:
use hashbrown::HashMap;
let mut map = HashMap::new();
map.insert(1, "one");
This crate has the following Cargo features:
nightly
: Enables nightly-only features including: #[may_dangle]
.serde
: Enables serde serialization support.rayon
: Enables rayon parallel iterator support.equivalent
: Allows comparisons to be customized with the Equivalent
trait. (enabled by default)raw-entry
: Enables access to the deprecated RawEntry
API.inline-more
: Adds inline hints to most functions, improving run-time performance at the cost
of compilation time. (enabled by default)default-hasher
: Compiles with foldhash as default hasher. (enabled by default)allocator-api2
: Enables support for allocators that support allocator-api2
. (enabled by default)Licensed under either of:
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.