Registry / utility / phf-macros

phf-macros

JSON →
library0.13.1rscratesunverified

Macros to generate types in the phf crate.

# Cargo.toml [dependencies] phf_macros = "0.13.1"
INSTALL
IMPORT
SIG · PHF-MACROS
P
phf-macros
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 generated perfect hash map.

use phf::phf_map; static MY_MAP: phf::Map<&'static str, i32> = phf_map! { "one" => 1, "two" => 2, }; fn main() { println!("{:?}", MY_MAP.get("one")); }
Debug
Known issues
gotchaRequires the 'macros' feature of the phf crate to be enabled.
fix
Add phf = { version = "0.13", features = ["macros"] } to Cargo.toml.
affects: >=0.13.0
Upgrade
Version history
0.13.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
phf-macros — cargo add phf-macros · libregistry