Enum cedar_policy::TypeErrorKind
source · #[non_exhaustive]pub enum TypeErrorKind {
Show 13 variants
UnexpectedType(UnexpectedType),
IncompatibleTypes(IncompatibleTypes),
UnsafeAttributeAccess(UnsafeAttributeAccess),
UnsafeOptionalAttributeAccess(UnsafeOptionalAttributeAccess),
ImpossiblePolicy,
UndefinedFunction(UndefinedFunction),
MultiplyDefinedFunction(MultiplyDefinedFunction),
WrongNumberArguments(WrongNumberArguments),
WrongCallStyle(WrongCallStyle),
FunctionArgumentValidationError(FunctionArgumentValidationError),
EmptySetForbidden,
NonLitExtConstructor,
HierarchyNotRespected(HierarchyNotRespected),
}
Expand description
Represents the different kinds of type errors and contains information specific to that type error kind.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
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.
ImpossiblePolicy
ImpossiblePolicy
is now a warning rather than an errorThe typechecker found that a policy condition will always evaluate to false.
UndefinedFunction(UndefinedFunction)
Undefined extension function.
MultiplyDefinedFunction(MultiplyDefinedFunction)
Multiply defined extension function.
WrongNumberArguments(WrongNumberArguments)
Incorrect number of arguments in an extension function application.
WrongCallStyle(WrongCallStyle)
Incorrect call style in an extension function application.
FunctionArgumentValidationError(FunctionArgumentValidationError)
Error returned by custom extension function argument validation
EmptySetForbidden
NonLitExtConstructor
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.
Trait Implementations§
source§impl Clone for TypeErrorKind
impl Clone for TypeErrorKind
source§fn clone(&self) -> TypeErrorKind
fn clone(&self) -> TypeErrorKind
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TypeErrorKind
impl Debug for TypeErrorKind
source§impl Diagnostic for TypeErrorKind
impl Diagnostic for TypeErrorKind
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 TypeErrorKind
impl Display for TypeErrorKind
source§impl Error for TypeErrorKind
impl Error for TypeErrorKind
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<TypeErrorKind> for ValidationErrorKind
impl From<TypeErrorKind> for ValidationErrorKind
source§fn from(source: TypeErrorKind) -> ValidationErrorKind
fn from(source: TypeErrorKind) -> ValidationErrorKind
source§impl Hash for TypeErrorKind
impl Hash for TypeErrorKind
source§impl PartialEq for TypeErrorKind
impl PartialEq for TypeErrorKind
source§fn eq(&self, other: &TypeErrorKind) -> bool
fn eq(&self, other: &TypeErrorKind) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for TypeErrorKind
impl StructuralPartialEq for TypeErrorKind
Auto Trait Implementations§
impl Freeze for TypeErrorKind
impl RefUnwindSafe for TypeErrorKind
impl Send for TypeErrorKind
impl Sync for TypeErrorKind
impl Unpin for TypeErrorKind
impl UnwindSafe for TypeErrorKind
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<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