#[non_exhaustive]pub struct Violation {
pub field_path: String,
pub rule_path: String,
pub rule_id: String,
pub message: String,
pub field_descriptor: Option<FieldDescriptor>,
pub field_value: Option<Value>,
pub rule_descriptor: Option<FieldDescriptor>,
pub rule_value: Option<Value>,
pub proto: Violation,
}Expand description
A single instance where a validation rule was not met.
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_path: StringThe dot-separated field path where the violation occurred (e.g. email, home.lat).
rule_path: StringThe dot-separated rule path that was violated (e.g. string.min_len).
rule_id: StringMachine-readable constraint identifier (e.g. string.min_len, required).
message: StringHuman-readable violation message.
field_descriptor: Option<FieldDescriptor>The field descriptor for the violated field, if available.
field_value: Option<Value>The field value that failed validation, when available.
rule_descriptor: Option<FieldDescriptor>The descriptor for the violated rule field, when available.
rule_value: Option<Value>The value of the violated rule field, when available.
proto: ViolationWire-compatible violation payload.
Trait Implementations§
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> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
Attempts to downcast this to
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
Attempts to downcast this to
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
Attempts to downcast this to
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
Attempts to downcast this to
T behind Arc pointerSource§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