pub struct Violation {
pub invariant: Invariant,
pub path: String,
pub detail: String,
}Expand description
An array the guard will not let through.
The three fields are the three questions somebody debugging this asks in order: which rule, where in the batch, and what the numbers were. A message that answers only the first is the reason people stop reading error messages.
Fields§
§invariant: InvariantThe rule that was broken.
path: StringWhere in the batch, as a dotted path of field names.
detail: StringThe numbers, for whoever has to fix the decoder.
Trait Implementations§
impl Eq for Violation
Source§impl Error for Violation
impl Error for Violation
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
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