Struct cedar_policy::ValidationError
source · pub struct ValidationError<'a> { /* private fields */ }Expand description
An error generated by the validator when it finds a potential problem in a policy. The error contains a enumeration that specifies the kind of problem, and provides details specific to that kind of problem. The error also records where the problem was encountered.
Implementations§
source§impl<'a> ValidationError<'a>
impl<'a> ValidationError<'a>
sourcepub fn error_kind(&self) -> &ValidationErrorKind
pub fn error_kind(&self) -> &ValidationErrorKind
Extract details about the exact issue detected by the validator.
sourcepub fn location(&self) -> &SourceLocation<'a>
pub fn location(&self) -> &SourceLocation<'a>
Extract the location where the validator found the issue.
Trait Implementations§
source§impl<'a> Clone for ValidationError<'a>
impl<'a> Clone for ValidationError<'a>
source§fn clone(&self) -> ValidationError<'a>
fn clone(&self) -> ValidationError<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<'a> Debug for ValidationError<'a>
impl<'a> Debug for ValidationError<'a>
source§impl<'a> Diagnostic for ValidationError<'a>
impl<'a> Diagnostic for ValidationError<'a>
source§fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
Labels to apply to this
Diagnostic’s Diagnostic::source_codesource§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Source code to apply this
Diagnostic’s Diagnostic::labels to.source§fn code<'s>(&'s self) -> Option<Box<dyn Display + 's>>
fn code<'s>(&'s self) -> Option<Box<dyn Display + 's>>
Unique diagnostic code that can be used to look up more information
about this
Diagnostic. Ideally also globally unique, and documented
in the toplevel crate’s documentation for easy searching. Rust path
format (foo::bar::baz) is recommended, but more classic codes like
E0123 or enums will work just fine.source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
Diagnostic severity. This may be used by
ReportHandlers to change the display format
of this diagnostic. Read moresource§fn url<'s>(&'s self) -> Option<Box<dyn Display + 's>>
fn url<'s>(&'s self) -> Option<Box<dyn Display + 's>>
URL to visit for a more detailed explanation/help about this
Diagnostic.source§fn help<'s>(&'s self) -> Option<Box<dyn Display + 's>>
fn help<'s>(&'s self) -> Option<Box<dyn Display + 's>>
Additional help text related to this
Diagnostic. Do you have any
advice for the poor soul who’s just run into this issue?Additional related
Diagnostics.source§fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
The cause of the error.
source§impl<'a> Display for ValidationError<'a>
impl<'a> Display for ValidationError<'a>
source§impl<'a> Error for ValidationError<'a>
impl<'a> Error for ValidationError<'a>
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl<'a> Freeze for ValidationError<'a>
impl<'a> RefUnwindSafe for ValidationError<'a>
impl<'a> Send for ValidationError<'a>
impl<'a> Sync for ValidationError<'a>
impl<'a> Unpin for ValidationError<'a>
impl<'a> UnwindSafe for ValidationError<'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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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