Struct cedar_policy_validator::ValidationResult
source · pub struct ValidationResult<'a> { /* 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<'a> ValidationResult<'a>
impl<'a> ValidationResult<'a>
pub fn new( errors: impl IntoIterator<Item = ValidationError<'a>>, warnings: impl IntoIterator<Item = ValidationWarning<'a>> ) -> Self
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<'a>>, impl Iterator<Item = ValidationWarning<'a>>)
pub fn into_errors_and_warnings( self ) -> (impl Iterator<Item = ValidationError<'a>>, impl Iterator<Item = ValidationWarning<'a>>)
Get an iterator over the errors and warnings found by the validator.
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for ValidationResult<'a>
impl<'a> Send for ValidationResult<'a>
impl<'a> Sync for ValidationResult<'a>
impl<'a> Unpin for ValidationResult<'a>
impl<'a> UnwindSafe for ValidationResult<'a>
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