rainier-validation-1.1.0 has been yanked.
rainier-validation
Validation and request contracts: the [Rule] set, the [Validator]
that applies it, and [FormRequest] — the contract a controller action
declares instead of checking input by hand.
use ;
use json;
let validator = new
.rules
.rules;
let errors = validator
.validate
.unwrap_err;
assert!;
The three states of a field
Absent, null and empty are distinct, and only the presence rules
(Required, Present, NotNull) look at the first two. Every other rule
skips a field that is not there — so [Rule::Email] means "if supplied it
must be an email" and [Rule::Required, Rule::Email] means "must be
supplied, and must be an email". See [rule] for the full argument.