Skip to main content

invalid_field

Function invalid_field 

Source
pub fn invalid_field(field: &str, reason: &str) -> ValidError
Expand description

Builds a ValidError::InvalidValue naming a field and a short reason.

Used by the Validated derive for checks that have no dedicated ValidError variant (length, range, and postcode checks); also handy for hand-written validators that want uniform error formatting.