Tags / 10 posts

#nutype

2026 2 posts

  1. 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.

  2. 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

  1. Nutype 0.6.2 - Deriving Arbitrary Traits with derive_unsafe

    Derive 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

  1. 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.

  2. 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.

  3. 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

  1. 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.

  2. 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.

  3. 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.

  4. 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.