pub enum EvaluationError {
Show 13 variants
EntityDoesNotExist(Arc<EntityUID>),
EntityAttrDoesNotExist {
entity: Arc<EntityUID>,
attr: SmolStr,
},
UnspecifiedEntityAccess(SmolStr),
RecordAttrDoesNotExist(SmolStr, Vec<SmolStr>),
FailedExtensionFunctionLookup(ExtensionsError),
TypeError {
expected: Vec<Type>,
actual: Type,
},
WrongNumArguments {
function_name: Name,
expected: usize,
actual: usize,
},
IntegerOverflow(IntegerOverflowError),
InvalidRestrictedExpression(RestrictedExpressionError),
UnlinkedSlot(SlotId),
FailedExtensionFunctionApplication {
extension_name: Name,
msg: String,
},
NonValue(Expr),
RecursionLimit,
}
Expand description
Errors that can occur during evaluation
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, Vec<SmolStr>)
Tried to get an attribute of a (non-entity) record, but that record didn’t have that attribute
FailedExtensionFunctionLookup(ExtensionsError)
An error occurred when looking up an extension function
TypeError
Tried to evaluate an operation on values with incorrect types for that operation
WrongNumArguments
Wrong number of arguments provided to an extension function
Fields
IntegerOverflow(IntegerOverflowError)
Overflow during an integer operation
InvalidRestrictedExpression(RestrictedExpressionError)
Error with the use of “restricted” expressions
UnlinkedSlot(SlotId)
Thrown when a policy is evaluated with a slot that is not linked to an
EntityUID
FailedExtensionFunctionApplication
Evaluation error thrown by an extension function
Fields
NonValue(Expr)
This error is raised if an expression contains unknowns and cannot be
reduced to a Value
. In order to return partial results, use the
partial evaluation APIs instead.
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
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>
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