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),
TypesMustMatch(TypesMustMatch),
EmptySetForbidden,
NonLitExtConstructor,
}
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
The 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
TypesMustMatch(TypesMustMatch)
EmptySetForbidden
NonLitExtConstructor
Trait Implementations§
source§impl Debug for TypeErrorKind
impl Debug for TypeErrorKind
source§impl Display for TypeErrorKind
impl Display for TypeErrorKind
source§impl Error for TypeErrorKind
impl Error for TypeErrorKind
1.30.0 · 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 Hash for TypeErrorKind
impl Hash for TypeErrorKind
source§impl PartialEq for TypeErrorKind
impl PartialEq for TypeErrorKind
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