rust-phf/rust-phf
Compile time static maps for Rust observed · 2026-08-28
Health v2 · maintenance only
96/100
- Activity 99
- Release rhythm 89
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 0.0
- age_days: 4611
- days_rel: 74
- days_push: 9
- n_releases_24m: 11
Adoption not part of the score
2183 stars · 138 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
Rust-PHF is a Rust library for generating efficient compile-time static maps and sets using perfect hash functions (CHD algorithm by default, with an experimental ptrhash layout). It supports construction via procedural macros (phf_macros) or build-time code generation (phf_codegen), and works in no_std environments.
Use cases
- create static lookup tables at compile time in Rust
- map string keywords to enum values with zero runtime hashing cost
- build static maps in no_std embedded Rust projects
- generate perfect hash tables in build.rs with phf_codegen
- look up operators or tokens by multiple key aliases
When to choose
- you need fast, allocation-free static maps or sets known at compile time
- you want zero-cost lookup tables in no_std or embedded environments
- you're writing parsers or interpreters with fixed keyword tables
When to avoid
- you need mutable or runtime-constructed maps
- your keys are only known at runtime
- you need ordered maps or rich map APIs beyond lookup
Facets
library · maturity stable
serialization developer-tools programming-languages developer-tools rust cross-platform perfect-hash compile-time static-maps no-std proc-macros lookup-tables algorithms
1 source
- readme: https://github.com/rust-phf/rust-phf · fetched 2026-08-28 · e79b44583fa1
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| rust-phf/rust-phf | main | 96 |
For agents
markdown · JSON · MCP: product_card(name="rust-phf/rust-phf")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem