pub enum ValidationError {
Show 16 variants
UnrecognizedEntityType(UnrecognizedEntityType),
UnrecognizedActionId(UnrecognizedActionId),
InvalidActionApplication(InvalidActionApplication),
UnexpectedType(UnexpectedType),
IncompatibleTypes(IncompatibleTypes),
UnsafeAttributeAccess(UnsafeAttributeAccess),
UnsafeOptionalAttributeAccess(UnsafeOptionalAttributeAccess),
UnsafeTagAccess(UnsafeTagAccess),
NoTagsAllowed(NoTagsAllowed),
UndefinedFunction(UndefinedFunction),
WrongNumberArguments(WrongNumberArguments),
FunctionArgumentValidation(FunctionArgumentValidation),
EmptySetForbidden(EmptySetForbidden),
NonLitExtConstructor(NonLitExtConstructor),
HierarchyNotRespected(HierarchyNotRespected),
InternalInvariantViolation(InternalInvariantViolation),
}
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.
Variants§
UnrecognizedEntityType(UnrecognizedEntityType)
A policy contains an entity type that is not declared in the schema.
UnrecognizedActionId(UnrecognizedActionId)
A policy contains an action that is not declared in the schema.
InvalidActionApplication(InvalidActionApplication)
There is no action satisfying the action scope constraint that can be applied to a principal and resources that both satisfy their respective scope conditions.
UnexpectedType(UnexpectedType)
The typechecker expected to see a subtype of one of the types in
expected
, but saw actual
.
IncompatibleTypes(IncompatibleTypes)
The typechecker could not compute a least upper bound for types
.
UnsafeAttributeAccess(UnsafeAttributeAccess)
The typechecker detected an access to a record or entity attribute that it could not statically guarantee would be present.
UnsafeOptionalAttributeAccess(UnsafeOptionalAttributeAccess)
The typechecker could not conclude that an access to an optional attribute was safe.
UnsafeTagAccess(UnsafeTagAccess)
The typechecker could not conclude that an access to a tag was safe.
NoTagsAllowed(NoTagsAllowed)
.getTag()
on an entity type which cannot have tags according to the schema.
UndefinedFunction(UndefinedFunction)
Undefined extension function.
WrongNumberArguments(WrongNumberArguments)
Incorrect number of arguments in an extension function application.
FunctionArgumentValidation(FunctionArgumentValidation)
Incorrect call style in an extension function application. Error returned by custom extension function argument validation
EmptySetForbidden(EmptySetForbidden)
The policy uses an empty set literal in a way that is forbidden
NonLitExtConstructor(NonLitExtConstructor)
The policy passes a non-literal to an extension constructor, which is forbidden in strict validation
HierarchyNotRespected(HierarchyNotRespected)
To pass strict validation a policy cannot contain an in
expression
where the entity type on the left might not be able to be a member of
the entity type on the right.
InternalInvariantViolation(InternalInvariantViolation)
Returned when an internal invariant is violated (should not happen; if this is ever returned, please file an issue)
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§fn clone(&self) -> ValidationError
fn clone(&self) -> ValidationError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Diagnostic for ValidationError
impl Diagnostic for ValidationError
Source§fn code(&self) -> Option<Box<dyn Display + '_>>
fn code(&self) -> Option<Box<dyn Display + '_>>
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 help(&self) -> Option<Box<dyn Display + '_>>
fn help(&self) -> Option<Box<dyn Display + '_>>
Diagnostic
. Do you have any
advice for the poor soul who’s just run into this issue?Source§fn severity(&self) -> Option<Severity>
fn severity(&self) -> Option<Severity>
ReportHandler
s to change the display format
of this diagnostic. Read moreSource§fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
fn labels(&self) -> Option<Box<dyn Iterator<Item = LabeledSpan> + '_>>
Diagnostic
’s Diagnostic::source_code
Source§fn source_code(&self) -> Option<&dyn SourceCode>
fn source_code(&self) -> Option<&dyn SourceCode>
Diagnostic
’s Diagnostic::labels
to.Diagnostic
s.Source§fn url(&self) -> Option<Box<dyn Display + '_>>
fn url(&self) -> Option<Box<dyn Display + '_>>
Diagnostic
.Source§fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
fn diagnostic_source(&self) -> Option<&dyn Diagnostic>
Source§impl Display for ValidationError
impl Display for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<EmptySetForbidden> for ValidationError
impl From<EmptySetForbidden> for ValidationError
Source§fn from(source: EmptySetForbidden) -> Self
fn from(source: EmptySetForbidden) -> Self
Source§impl From<FunctionArgumentValidation> for ValidationError
impl From<FunctionArgumentValidation> for ValidationError
Source§fn from(source: FunctionArgumentValidation) -> Self
fn from(source: FunctionArgumentValidation) -> Self
Source§impl From<HierarchyNotRespected> for ValidationError
impl From<HierarchyNotRespected> for ValidationError
Source§fn from(source: HierarchyNotRespected) -> Self
fn from(source: HierarchyNotRespected) -> Self
Source§impl From<IncompatibleTypes> for ValidationError
impl From<IncompatibleTypes> for ValidationError
Source§fn from(source: IncompatibleTypes) -> Self
fn from(source: IncompatibleTypes) -> Self
Source§impl From<InternalInvariantViolation> for ValidationError
impl From<InternalInvariantViolation> for ValidationError
Source§fn from(source: InternalInvariantViolation) -> Self
fn from(source: InternalInvariantViolation) -> Self
Source§impl From<InvalidActionApplication> for ValidationError
impl From<InvalidActionApplication> for ValidationError
Source§fn from(source: InvalidActionApplication) -> Self
fn from(source: InvalidActionApplication) -> Self
Source§impl From<NoTagsAllowed> for ValidationError
impl From<NoTagsAllowed> for ValidationError
Source§fn from(source: NoTagsAllowed) -> Self
fn from(source: NoTagsAllowed) -> Self
Source§impl From<NonLitExtConstructor> for ValidationError
impl From<NonLitExtConstructor> for ValidationError
Source§fn from(source: NonLitExtConstructor) -> Self
fn from(source: NonLitExtConstructor) -> Self
Source§impl From<UndefinedFunction> for ValidationError
impl From<UndefinedFunction> for ValidationError
Source§fn from(source: UndefinedFunction) -> Self
fn from(source: UndefinedFunction) -> Self
Source§impl From<UnexpectedType> for ValidationError
impl From<UnexpectedType> for ValidationError
Source§fn from(source: UnexpectedType) -> Self
fn from(source: UnexpectedType) -> Self
Source§impl From<UnrecognizedActionId> for ValidationError
impl From<UnrecognizedActionId> for ValidationError
Source§fn from(source: UnrecognizedActionId) -> Self
fn from(source: UnrecognizedActionId) -> Self
Source§impl From<UnrecognizedEntityType> for ValidationError
impl From<UnrecognizedEntityType> for ValidationError
Source§fn from(source: UnrecognizedEntityType) -> Self
fn from(source: UnrecognizedEntityType) -> Self
Source§impl From<UnsafeAttributeAccess> for ValidationError
impl From<UnsafeAttributeAccess> for ValidationError
Source§fn from(source: UnsafeAttributeAccess) -> Self
fn from(source: UnsafeAttributeAccess) -> Self
Source§impl From<UnsafeOptionalAttributeAccess> for ValidationError
impl From<UnsafeOptionalAttributeAccess> for ValidationError
Source§fn from(source: UnsafeOptionalAttributeAccess) -> Self
fn from(source: UnsafeOptionalAttributeAccess) -> Self
Source§impl From<UnsafeTagAccess> for ValidationError
impl From<UnsafeTagAccess> for ValidationError
Source§fn from(source: UnsafeTagAccess) -> Self
fn from(source: UnsafeTagAccess) -> Self
Source§impl From<WrongNumberArguments> for ValidationError
impl From<WrongNumberArguments> for ValidationError
Source§fn from(source: WrongNumberArguments) -> Self
fn from(source: WrongNumberArguments) -> Self
Source§impl Hash for ValidationError
impl Hash for ValidationError
Source§impl PartialEq for ValidationError
impl PartialEq for ValidationError
impl Eq for ValidationError
impl StructuralPartialEq for ValidationError
Auto Trait Implementations§
impl Freeze for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnwindSafe for ValidationError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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>
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>
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