1[package]
2name = "hashbrown"
3version = "0.16.1"
4authors = ["Amanieu d'Antras <amanieu@gmail.com>"]
5description = "A Rust port of Google's SwissTable hash map"
6license = "MIT OR Apache-2.0"
7repository = "https://github.com/rust-lang/hashbrown"
8readme = "README.md"
9keywords = ["hash", "no_std", "hashmap", "swisstable"]
10categories = ["data-structures", "no-std"]
11exclude = [".github", "/ci/*"]
12edition = "2021"
13rust-version = "1.65.0"
14
15[dependencies]
16# For the default hasher
17foldhash = { version = "0.2.0", default-features = false, optional = true }
18
19# For external trait impls
20rayon = { version = "1.9.0", optional = true }
21serde_core = { version = "1.0.221", default-features = false, optional = true }
22
23# When built as part of libstd
24core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }
25alloc = { version = "1.0.0", optional = true, package = "rustc-std-workspace-alloc" }
26
27# Support for allocators that use allocator-api2
28allocator-api2 = { version = "0.2.9", optional = true, default-features = false, features = [
29 "alloc",
30] }
31
32# Equivalent trait which can be shared with other hash table implementations.
33# NB: this is a public dependency because `Equivalent` is re-exported!
34equivalent = { version = "1.0", optional = true, default-features = false }
35
36# serde v1.0.220 is the first version that released with `serde_core`.
37# This is required to avoid conflict with other `serde` users which may require an older version.
38[target.'cfg(any())'.dependencies]
39serde = { version = "1.0.220", default-features = false, optional = true }
40
41[dev-dependencies]
42lazy_static = "1.4"
43rand = { version = "0.9.0", features = ["small_rng"] }
44rayon = "1.2"
45fnv = "1.0.7"
46serde_test = "1.0"
47bumpalo = { version = "3.13.0", features = ["allocator-api2"] }
48
49[target.'cfg(unix)'.dev-dependencies]
50libc = "0.2.155"
51
52[features]
53default = ["default-hasher", "inline-more", "allocator-api2", "equivalent", "raw-entry"]
54
55# Enables use of nightly features. This is only guaranteed to work on the latest
56# version of nightly Rust.
57nightly = ["foldhash?/nightly", "bumpalo/allocator_api"]
58
59# Enables the RustcEntry API used to provide the standard library's Entry API.
60rustc-internal-api = []
61
62# Internal feature used when building as part of the standard library.
63rustc-dep-of-std = [
64 "nightly",
65 "core",
66 "alloc",
67 "rustc-internal-api",
68]
69
70# Enables serde support.
71serde = ["dep:serde_core", "dep:serde"]
72
73# Enables the deprecated RawEntry API.
74raw-entry = []
75
76# Provides a default hasher. Currently this is foldhash but this is subject to
77# change in the future. Note that the default hasher does *not* provide HashDoS
78# resistance, unlike the one in the standard library.
79default-hasher = ["dep:foldhash"]
80
81# Enables usage of `#[inline]` on far more functions than by default in this
82# crate. This may lead to a performance increase but often comes at a compile
83# time cost.
84inline-more = []
85
86[package.metadata.docs.rs]
87features = ["nightly", "rayon", "serde", "raw-entry"]
88rustdoc-args = ["--generate-link-to-definition"]
89