Cargo Features

[dependencies]
hashbrown = { version = "0.15.1", default-features = false, features = ["nightly", "rustc-internal-api", "rustc-dep-of-std", "raw-entry", "default-hasher", "inline-more", "rayon", "serde", "allocator-api2", "equivalent"] }
default = allocator-api2, default-hasher, equivalent, inline-more, raw-entry

These default features are set whenever hashbrown is added without default-features = false somewhere in the dependency tree.

nightly rustc-dep-of-std?

Enables use of nightly features. This is only guaranteed to work on the latest version of nightly Rust.

Enables allocator_api of bumpalo and nightly of optional allocator-api2

Support for allocators that use allocator-api2

rustc-internal-api rustc-dep-of-std?

Enables the RustcEntry API used to provide the standard library's Entry API.

rustc-dep-of-std = alloc, compiler_builtins, core, nightly, raw-entry, rustc-internal-api

Internal feature used when building as part of the standard library.

raw-entry default rustc-dep-of-std?

Enables the deprecated RawEntry API.

default-hasher default

Provides a default hasher. Currently this is foldhash but this is subject to change in the future. Note that the default hasher does *not* provide HashDoS resistance, unlike the one in the standard library.

Enables foldhash

For the default hasher

Affects hashbrown::DefaultHashBuilder

inline-more default

Enables usage of #[inline] on far more functions than by default in this crate. This may lead to a performance increase but often comes at a compile time cost.

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

alloc rustc-dep-of-std?

Enables rustc-std-workspace-alloc

rayon implicit feature

Enables rayon

For external trait impls

Affects hashbrown::hash_map.rayon, hashbrown::hash_set.rayon, hashbrown::hash_table.rayon

serde implicit feature

Enables serde

serde:

A generic serialization/deserialization framework

core rustc-dep-of-std?

Enables rustc-std-workspace-core

When built as part of libstd

compiler_builtins rustc-dep-of-std?
allocator-api2 default
equivalent default

Enables equivalent

Equivalent trait which can be shared with other hash table implementations.