pub struct ValidationResult { /* private fields */ }
Expand description
Contains the result of policy validation. The result includes the list of issues found by validation and whether validation succeeds or fails. Validation succeeds if there are no fatal errors. There may still be non-fatal warnings present when validation passes.
Implementations§
Source§impl ValidationResult
impl ValidationResult
Sourcepub fn new(
errors: impl IntoIterator<Item = ValidationError>,
warnings: impl IntoIterator<Item = ValidationWarning>,
) -> Self
pub fn new( errors: impl IntoIterator<Item = ValidationError>, warnings: impl IntoIterator<Item = ValidationWarning>, ) -> Self
Create a new ValidationResult
with these errors and warnings.
Empty iterators are allowed for either or both arguments.
Sourcepub fn validation_passed(&self) -> bool
pub fn validation_passed(&self) -> bool
True when validation passes. There are no errors, but there may be non-fatal warnings.
Sourcepub fn validation_errors(&self) -> impl Iterator<Item = &ValidationError>
pub fn validation_errors(&self) -> impl Iterator<Item = &ValidationError>
Get an iterator over the errors found by the validator.
Sourcepub fn validation_warnings(&self) -> impl Iterator<Item = &ValidationWarning>
pub fn validation_warnings(&self) -> impl Iterator<Item = &ValidationWarning>
Get an iterator over the warnings found by the validator.
Sourcepub fn into_errors_and_warnings(
self,
) -> (impl Iterator<Item = ValidationError>, impl Iterator<Item = ValidationWarning>)
pub fn into_errors_and_warnings( self, ) -> (impl Iterator<Item = ValidationError>, impl Iterator<Item = ValidationWarning>)
Get an iterator over the errors and warnings found by the validator.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ValidationResult
impl RefUnwindSafe for ValidationResult
impl Send for ValidationResult
impl Sync for ValidationResult
impl Unpin for ValidationResult
impl UnwindSafe for ValidationResult
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more