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
Uh oh!
There was an error while loading. Please reload this page.
-
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
greaterless#[nutype(derive(Debug))]. The regular#[derive(Debug)]syntax is not supported anymore.withhas been renamed topredicateto reflect the boolean nature of its rangemin_lenhas been renamed tolen_char_minto reflect that is based on UTF8 chars.max_lenhas been renamed tolen_char_maxto reflect that is based on UTF8 chars.maxtoless_or_equalmintogreater_or_equal<ValidationRule>Violated. This implies the following renames:TooShort->LenCharMinViolatedTooLong->LenCharMaxViolatedEmpty->NotEmptyViolatedRegexMismatch->RegexViolatedInvalid->PredicateViolatedTooBig->LessOrEqualViolatedTooSmall->GreaterOrEqualViolatedNotFinite->FiniteViolatedDeserializework 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
minandmaxintegers 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