pub struct ValidationError {
pub loc: Loc,
pub kind: ErrorKind,
pub severity: Severity,
pub input: Option<String>,
pub msg: String,
}Expand description
A single validation failure at a precise Loc.
Fields§
§loc: LocWhere in the config tree the failure occurred.
kind: ErrorKindThe structured reason.
severity: SeverityHow severe this failure is.
input: Option<String>The offending value, stringified, if it was captured.
msg: StringHuman-readable message.
Implementations§
Source§impl ValidationError
impl ValidationError
Sourcepub fn is_fatal(&self) -> bool
pub fn is_fatal(&self) -> bool
Whether this error requires an immediate halt (severity == Fatal).
Sourcepub fn repair_hint(&self) -> String
pub fn repair_hint(&self) -> String
Auto-derived repair suggestion based on the error kind.
For custom predicates the message itself is the best hint; for built-in kinds the hint is derived from the constraint parameters.
This implements Van der Aalst’s alignment repair concept: given a deviation from the reference model, what is the minimum edit?
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§fn clone(&self) -> ValidationError
fn clone(&self) -> ValidationError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
impl Eq for ValidationError
Source§impl PartialEq for ValidationError
impl PartialEq for ValidationError
Source§fn eq(&self, other: &ValidationError) -> bool
fn eq(&self, other: &ValidationError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ValidationError
Auto Trait Implementations§
impl Freeze for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnsafeUnpin for ValidationError
impl UnwindSafe for ValidationError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.