pub struct Violation {
pub path: Vec<usize>,
pub kind: ViolationKind,
pub child: Option<usize>,
pub mark: Option<usize>,
}Expand description
A single schema violation, located by the offending node’s index path.
Fields§
§path: Vec<usize>Index path to the node (root = []), as used by Node::node_at.
kind: ViolationKindWhat’s wrong.
child: Option<usize>Index (in the node’s content) of the offending child: the disallowed
child for ViolationKind::DisallowedChild, or the first child that
cannot be matched for ViolationKind::InvalidContent. None for
other kinds, and for InvalidContent when every child matched but the
expression needs more (e.g. block+ with no children).
mark: Option<usize>Index (in the node’s marks) of the mark the violation is about, for
ViolationKind::UnknownMark, ViolationKind::DisallowedMark and
attribute violations raised on a mark. None when it is about the node.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Violation
impl<'de> Deserialize<'de> for Violation
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 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