Compile-time perfect-hash lookup tables for Rust
open sourceMITfree
Rust-PHF generates efficient static maps and sets for Rust at compile time with perfect hash functions, using the CHD algorithm by default with an experimental ptrhash layout. Tables are built with procedural macros (phf_macros) or build-script code generation (phf_codegen), and the phf crate works in no_std environments with default features off.
Problems it solves
- build a static lookup table at compile time in Rust
- a constant HashMap of keywords in Rust
- fast keyword lookup without runtime hashing setup in Rust
Features
- compile-time static maps and sets
- perfect hashing with CHD, experimental ptrhash
- macros or build-script code generation
- no_std support
Alternatives
The same job
These do what Rust-PHF does.