Nutype 0.4.0 #106
greyblake
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For this release I'd like to thank Daniyil Glushko, who offered his help and did a very good job.
Daniyil is located in Zaporizhzhia (Ukraine) and could be interested in a Rust job. If you're looking for a Rust developer remotely, I'd recommend contacting him.
Changes
greater
less
#[nutype(derive(Debug))]
. The regular#[derive(Debug)]
syntax is not supported anymore.with
has been renamed topredicate
to reflect the boolean nature of its rangemin_len
has been renamed tolen_char_min
to reflect that is based on UTF8 chars.max_len
has been renamed tolen_char_max
to reflect that is based on UTF8 chars.max
toless_or_equal
min
togreater_or_equal
<ValidationRule>Violated
. This implies the following renames:TooShort
->LenCharMinViolated
TooLong
->LenCharMaxViolated
Empty
->NotEmptyViolated
RegexMismatch
->RegexViolated
Invalid
->PredicateViolated
TooBig
->LessOrEqualViolated
TooSmall
->GreaterOrEqualViolated
NotFinite
->FiniteViolated
Deserialize
work with RON formatFeature highlights
Arbitrary inner type
Previously
#[nutype]
worked only withString
, integers and floats.Now it's possible to use it with any arbitrary type (e.g.
Vec<String>
):New numeric validators
Instead of former
min
andmax
integers and floats can now be validated with:greater_or_equal
- Inclusive lower boundgreater
- Exclusive lower boundless_or_equal
- Inclusive upper boundless
- Exclusive upper boundExample:
Derive
Deriving of traits now has to be done explicitly with
#[nutype(derive(...))]
instead of#[derive(...)]
:Example:
This makes it clear, that deriving is fully handled by
#[nutype]
and prevents a potential confusion.This discussion was created from the release Nutype 0.4.0.
Beta Was this translation helpful? Give feedback.
All reactions