Tags / 10 posts
#nutype
2026 2 posts
-
Nutype 0.8.0 - attribute passthrough, serde customization and Decimal
Attributes for repr, sqlx or garde now reach the generated type, and validation still runs after custom serde decoding.
-
Nutype 0.7.0 - conditional derives with cfg_attr and more
Gate derives on any cfg predicate with cfg_attr, restrict constructor visibility, validate UTF-16 length, and use derive_unchecked, formerly derive_unsafe.
2025 1 post
-
Nutype 0.6.2 - Deriving Arbitrary Traits with
derive_unsafeDerive any third-party trait on a newtype behind an opt-in feature flag, with the caveat that traits like DerefMut can break its invariants.
2024 3 posts
-
Nutype 0.5.0 - custom errors!
Plug in your own validation function and error type, and build validated newtypes with try_new() now that the fallible new() is gone.
-
Nutype 0.4.3 - generic newtypes!
Newtypes can now be generic, like NonEmpty<T> over Vec<T>, with bounds such as T: Ord when a sanitizer needs to sort.
-
Nutype 0.4.2 with Arbitrary support!
A derived Arbitrary generates only values that pass the newtype’s validation, so fuzzing and property tests always get valid inputs.
2023 4 posts
-
Announcing Nutype 0.4.0 Release
Nutype can now wrap any inner type such as Vec<String>, min and max become greater_or_equal and less_or_equal, and error variants get names like NotEmptyViolated.
-
Nutype 0.3.0 released
The finite validator lets float newtypes derive Eq and Ord, and a derived Default gets a generated test that checks its value is valid.
-
Nutype 0.2.0 is out!
Validate string newtypes against a regex, inline or from a lazy_static or once_cell static, or skip all checks with new_unchecked in an unsafe block.
-
Nutype: the newtype with guarantees!
Declare sanitize and validate rules and get a checked constructor plus error type, with no way to build an invalid value in safe Rust.