pub enum Validation {
Valid,
Invalid(Vec<Violation>),
Exhausted {
budget: usize,
},
}Expand description
What validating a value produced.
Variants§
Valid
The value satisfies the schema.
Invalid(Vec<Violation>)
It does not, and here is every reason why.
Exhausted
The step budget ran out before an answer was reached.
Deliberately not Invalid: a validator that ran out of budget has not
shown the value to be wrong, and reporting it as wrong would blame the
payload for the validator’s limit.
Implementations§
Source§impl Validation
impl Validation
Sourcepub fn is_valid(&self) -> bool
pub fn is_valid(&self) -> bool
Whether the value satisfied the schema.
Exhausted is not valid. It is not invalid either;
this is the question “may it pass”, and the answer is no.
Sourcepub fn is_decided(&self) -> bool
pub fn is_decided(&self) -> bool
Whether validation reached an answer at all.
false for exhaustion, which is what the checker turns into
Verdict::Inconclusive.
Trait Implementations§
Source§impl Clone for Validation
impl Clone for Validation
Source§impl Debug for Validation
impl Debug for Validation
impl Eq for Validation
Source§impl PartialEq for Validation
impl PartialEq for Validation
impl StructuralPartialEq for Validation
Auto Trait Implementations§
impl Freeze for Validation
impl RefUnwindSafe for Validation
impl Send for Validation
impl Sync for Validation
impl Unpin for Validation
impl UnsafeUnpin for Validation
impl UnwindSafe for Validation
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