pub struct SkippedValidation { /* private fields */ }Expand description
One validation occurrence that was skipped by the executor.
§Examples
use qubit_validator::{SkipReason, SkippedValidation, ValidationPath};
let skipped = SkippedValidation::missing_optional(
0,
ValidationPath::root().with_field("optional"),
);
assert_eq!(skipped.reason(), SkipReason::MissingOptional);Implementations§
Source§impl SkippedValidation
impl SkippedValidation
Sourcepub fn missing_optional(occurrence: usize, path: ValidationPath) -> Self
pub fn missing_optional(occurrence: usize, path: ValidationPath) -> Self
Sourcepub fn failed_prerequisite(
occurrence: usize,
path: ValidationPath,
prerequisites: Vec<FailureId>,
) -> Result<Self, ValidationOutcomeError>
pub fn failed_prerequisite( occurrence: usize, path: ValidationPath, prerequisites: Vec<FailureId>, ) -> Result<Self, ValidationOutcomeError>
Creates a record for an occurrence skipped after prerequisite failures.
§Parameters
occurrence: Zero-based declaration position of the skipped target.path: Structured path identifying the skipped target.prerequisites: Failure IDs that prevented this occurrence from running.
§Errors
Returns EmptyPrerequisites when no failure ID is supplied.
§Returns
A skipped occurrence containing the supplied prerequisite failure IDs.
Sourcepub const fn occurrence(&self) -> usize
pub const fn occurrence(&self) -> usize
Returns the zero-based declaration occurrence assigned by the executor.
§Returns
The occurrence number used to order this validation result.
Sourcepub const fn path(&self) -> &ValidationPath
pub const fn path(&self) -> &ValidationPath
Returns the structured path of the skipped target.
§Returns
A borrow of the target path stored in this record.
Sourcepub const fn reason(&self) -> SkipReason
pub const fn reason(&self) -> SkipReason
Returns why the executor did not run this occurrence.
§Returns
The policy reason that caused the skip.
Sourcepub fn prerequisites(&self) -> &[FailureId]
pub fn prerequisites(&self) -> &[FailureId]
Returns IDs of failures that prevented this occurrence.
§Returns
The prerequisite IDs, or an empty slice when an optional target was absent.
Trait Implementations§
Source§impl Clone for SkippedValidation
impl Clone for SkippedValidation
Source§impl Debug for SkippedValidation
impl Debug for SkippedValidation
impl Eq for SkippedValidation
Source§impl PartialEq for SkippedValidation
impl PartialEq for SkippedValidation
impl StructuralPartialEq for SkippedValidation
Auto Trait Implementations§
impl Forget for SkippedValidation
impl Freeze for SkippedValidation
impl RefUnwindSafe for SkippedValidation
impl Send for SkippedValidation
impl Sync for SkippedValidation
impl Unpin for SkippedValidation
impl UnsafeUnpin for SkippedValidation
impl UnwindSafe for SkippedValidation
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