#[non_exhaustive]pub struct Violation {
pub field: Option<&'static str>,
pub message: &'static str,
}Expand description
A single failed constraint, optionally associated with a named field.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.field: Option<&'static str>The field name, if validation was run on a named field.
message: &'static strA human-readable description of the constraint that failed.
Implementations§
Trait Implementations§
impl Eq for Violation
Source§impl From<Violation> for ValidationError
Available on crate feature alloc only.
impl From<Violation> for ValidationError
Available on crate feature
alloc only.impl StructuralPartialEq for Violation
Auto Trait Implementations§
impl Freeze for Violation
impl RefUnwindSafe for Violation
impl Send for Violation
impl Sync for Violation
impl Unpin for Violation
impl UnsafeUnpin for Violation
impl UnwindSafe for Violation
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