pub enum EvaluationErrorKind {
Show 13 variants
EntityDoesNotExist(Arc<EntityUID>),
EntityAttrDoesNotExist {
entity: Arc<EntityUID>,
attr: SmolStr,
},
UnspecifiedEntityAccess(SmolStr),
RecordAttrDoesNotExist(SmolStr, Vec<SmolStr>),
FailedExtensionFunctionLookup(ExtensionFunctionLookupError),
TypeError {
expected: Vec<Type>,
actual: Type,
},
WrongNumArguments {
function_name: Name,
expected: usize,
actual: usize,
},
IntegerOverflow(IntegerOverflowError),
InvalidRestrictedExpression(RestrictedExprError),
UnlinkedSlot(SlotId),
FailedExtensionFunctionApplication {
extension_name: Name,
msg: String,
},
NonValue(Expr),
RecursionLimit,
}
Expand description
Enumeration of the possible 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
Fields
Tried to get this attribute, but the specified entity didn’t have that attribute
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(ExtensionFunctionLookupError)
An error occurred when looking up an extension function
TypeError
Tried to evaluate an operation on values with incorrect types for that operation
WrongNumArguments
Fields
Wrong number of arguments provided to an extension function
IntegerOverflow(IntegerOverflowError)
Overflow during an integer operation
InvalidRestrictedExpression(RestrictedExprError)
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
Fields
Evaluation error thrown by an extension function
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 EvaluationErrorKind
impl Clone for EvaluationErrorKind
source§fn clone(&self) -> EvaluationErrorKind
fn clone(&self) -> EvaluationErrorKind
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for EvaluationErrorKind
impl Debug for EvaluationErrorKind
source§impl Diagnostic for EvaluationErrorKind
impl Diagnostic for EvaluationErrorKind
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 EvaluationErrorKind
impl Display for EvaluationErrorKind
source§impl Error for EvaluationErrorKind
impl Error for EvaluationErrorKind
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<ExtensionFunctionLookupError> for EvaluationErrorKind
impl From<ExtensionFunctionLookupError> for EvaluationErrorKind
source§fn from(source: ExtensionFunctionLookupError) -> Self
fn from(source: ExtensionFunctionLookupError) -> Self
source§impl From<RestrictedExprError> for EvaluationErrorKind
impl From<RestrictedExprError> for EvaluationErrorKind
source§fn from(source: RestrictedExprError) -> Self
fn from(source: RestrictedExprError) -> Self
source§impl PartialEq for EvaluationErrorKind
impl PartialEq for EvaluationErrorKind
source§fn eq(&self, other: &EvaluationErrorKind) -> bool
fn eq(&self, other: &EvaluationErrorKind) -> bool
self
and other
values to be equal, and is used
by ==
.