pub enum Reason {
FieldValueInvalid,
FieldValueForbidden,
FieldValueRequired,
FieldValueDuplicate,
}
Expand description
Reason is a machine-readable value providing more detail about why a field failed the validation.
More in docs
Variants§
FieldValueInvalid
FieldValueInvalid is used to report malformed values (e.g. failed regex match, too long, out of bounds).
FieldValueForbidden
FieldValueForbidden is used to report valid (as per formatting rules) values which would be accepted under some conditions, but which are not permitted by the current conditions (such as security policy).
FieldValueRequired
FieldValueRequired is used to report required values that are not provided (e.g. empty strings, null values, or empty arrays).
FieldValueDuplicate
FieldValueDuplicate is used to report collisions of values that must be unique (e.g. unique IDs).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Reason
impl<'de> Deserialize<'de> for Reason
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Reason
Auto Trait Implementations§
impl Freeze for Reason
impl RefUnwindSafe for Reason
impl Send for Reason
impl Sync for Reason
impl Unpin for Reason
impl UnwindSafe for Reason
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more