greyblake/nutype
Rust newtype with guarantees 🇺🇦 🦀 observed · 2026-08-28
Health v2 · maintenance only
80/100
- Activity 88
- Release rhythm 57
- 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: 108
- age_days: 1424
- days_rel: 130
- days_push: 76
- n_releases_24m: 6
Adoption not part of the score
1761 stars · 34 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
Nutype is a Rust procedural macro that enhances the newtype pattern with built-in sanitization and validation constraints. It guarantees that values cannot be instantiated without passing the defined checks, including during serde deserialization.
Use cases
- validate user input like usernames and emails in Rust
- enforce invariants on newtype wrappers
- sanitize and trim strings before storing them
- make invalid states unrepresentable with types
- validate data during serde deserialization
- define constrained numeric types with min/max bounds
When to choose
- you use Rust and want type-safe validated domain types
- you want validation enforced at construction time rather than scattered checks
- you need sanitization plus validation in one declarative macro
- you want invalid values rejected even through serde deserialization
When to avoid
- you need runtime-configurable validation rules
- your project is not in Rust
- you need validation across struct fields rather than single values
- you prefer schema-based validation libraries like validator with attribute macros on structs
Facets
library · maturity active
serialization type-system developer-tools developer-tools web-development programming-languages rust newtype validation sanitization proc-macro invariants type-safety serde
2 sources
- readme: https://github.com/greyblake/nutype · fetched 2026-08-28 · 9db641755a2f
- registry_crates: https://crates.io/api/v1/crates/nutype · fetched 2026-08-29 · e88c8238c86f
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| greyblake/nutype | main | 80 |
For agents
markdown · JSON · MCP: product_card(name="greyblake/nutype")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem