Registry / utility / phf
library0.13.1rscratesunverified

Runtime support for perfect hash function data structures.

# Cargo.toml [dependencies] phf = "0.13.1"
INSTALL
IMPORT
SIG · PHF
P
phf
utilityrustv0.13.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

phf_map
use phf::phf_map;

Creates a compile-time perfect hash map.

use phf::phf_map; static MY_MAP: phf::Map<&'static str, i32> = phf_map! { "foo" => 1, "bar" => 2, }; fn main() { println!("foo: {}", MY_MAP["foo"]); }
Debug
Known issues
gotchaRequires the `phf_macros` feature for the `phf_map!` macro.
fix
Add `features = ["macros"]` to phf dependency in Cargo.toml.
affects: >=0.8.0
Upgrade
Version history
0.13.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
phf — cargo add phf · libregistry