pub enum EvaluationError {
Show 13 variants
EntityDoesNotExist(Arc<EntityUID>),
EntityAttrDoesNotExist {
entity: Arc<EntityUID>,
attr: SmolStr,
},
UnspecifiedEntityAccess(SmolStr),
RecordAttrDoesNotExist(SmolStr),
ExtensionsError(ExtensionsError),
TypeError {
expected: Vec<Type>,
actual: Type,
},
WrongNumArguments {
op: ExtensionFunctionOp,
expected: usize,
actual: usize,
},
IntegerOverflow(IntegerOverflowError),
InvalidRestrictedExpression(RestrictedExpressionError),
TemplateInstantiationError(SlotId),
ExtensionError {
extension_name: Name,
msg: String,
},
NonValue(Expr),
RecursionLimit,
}Expand description
Error type for various kinds of errors that can be raised by the policy evaluator.
Variants§
EntityDoesNotExist(Arc<EntityUID>)
Tried to lookup this entity UID, but it didn’t exist in the provided entities
EntityAttrDoesNotExist
Tried to get this attribute, but the specified entity didn’t have that attribute
Fields
UnspecifiedEntityAccess(SmolStr)
Tried to access an attribute of an unspecified entity
RecordAttrDoesNotExist(SmolStr)
Tried to get this attribute of a (non-entity) record, but that record didn’t have that attribute
ExtensionsError(ExtensionsError)
Error thown by an operation on Extensions
(not to be confused with ExtensionError, which is an error thrown by
an individual extension function)
TypeError
Type error, showing the expected type and actual type
WrongNumArguments
Wrong number of arguments to an extension function
Fields
op: ExtensionFunctionOparguments to this function
IntegerOverflow(IntegerOverflowError)
Overflow during an integer operation
InvalidRestrictedExpression(RestrictedExpressionError)
Error with the use of “restricted” expressions
TemplateInstantiationError(SlotId)
Thrown when a policy is evaluated with an un-filled slot
ExtensionError
Evaluation error thrown by an extension function
Fields
NonValue(Expr)
Error raised if an expression did not reduce to a value when it was supposed to
RecursionLimit
Maximum recursion limit reached for expression evaluation
Trait Implementations§
Source§impl Clone for EvaluationError
impl Clone for EvaluationError
Source§fn clone(&self) -> EvaluationError
fn clone(&self) -> EvaluationError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EvaluationError
impl Debug for EvaluationError
Source§impl Display for EvaluationError
impl Display for EvaluationError
Source§impl Error for EvaluationError
impl Error for EvaluationError
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<ExtensionsError> for EvaluationError
impl From<ExtensionsError> for EvaluationError
Source§fn from(source: ExtensionsError) -> Self
fn from(source: ExtensionsError) -> Self
Source§impl From<RestrictedExpressionError> for EvaluationError
impl From<RestrictedExpressionError> for EvaluationError
Source§fn from(source: RestrictedExpressionError) -> Self
fn from(source: RestrictedExpressionError) -> Self
Source§impl PartialEq for EvaluationError
impl PartialEq for EvaluationError
impl StructuralPartialEq for EvaluationError
Auto Trait Implementations§
impl Freeze for EvaluationError
impl !RefUnwindSafe for EvaluationError
impl !Send for EvaluationError
impl !Sync for EvaluationError
impl Unpin for EvaluationError
impl !UnwindSafe for EvaluationError
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§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