pub enum EvaluationError {
VariableNotFound(Box<ErrorContext>),
TypeMismatch(Box<ErrorContext>),
UnsupportedOperator(Box<ErrorContext>),
ParseError(Box<ErrorContext>),
IndexOutOfBounds(Box<ErrorContext>),
FieldNotFound(Box<ErrorContext>),
}Variants§
VariableNotFound(Box<ErrorContext>)
A variable specified in the expression cannot be found.
TypeMismatch(Box<ErrorContext>)
Mismatch between expected and actual types during evaluation.
UnsupportedOperator(Box<ErrorContext>)
An operator is used with incompatible types.
ParseError(Box<ErrorContext>)
A value fails to parse into an expected type.
IndexOutOfBounds(Box<ErrorContext>)
An index is out of bounds during array access in a path.
FieldNotFound(Box<ErrorContext>)
A field/key is not found during object access in a path.
Implementations§
Source§impl EvaluationError
impl EvaluationError
Sourcepub fn variable_not_found(
variable_name: impl Into<String>,
source: Option<Box<dyn Error + Send + Sync + 'static>>,
metadata: Option<HashMap<String, String>>,
) -> Self
pub fn variable_not_found( variable_name: impl Into<String>, source: Option<Box<dyn Error + Send + Sync + 'static>>, metadata: Option<HashMap<String, String>>, ) -> Self
Creates a new VariableNotFound error.
The message for the ErrorContext should be the name of the variable.
Sourcepub fn type_mismatch(
message: impl Into<String>,
source: Option<Box<dyn Error + Send + Sync + 'static>>,
metadata: Option<HashMap<String, String>>,
) -> Self
pub fn type_mismatch( message: impl Into<String>, source: Option<Box<dyn Error + Send + Sync + 'static>>, metadata: Option<HashMap<String, String>>, ) -> Self
Creates a new TypeMismatch error.
The message for ErrorContext should describe the type mismatch.
Sourcepub fn unsupported_operator(
message: impl Into<String>,
source: Option<Box<dyn Error + Send + Sync + 'static>>,
metadata: Option<HashMap<String, String>>,
) -> Self
pub fn unsupported_operator( message: impl Into<String>, source: Option<Box<dyn Error + Send + Sync + 'static>>, metadata: Option<HashMap<String, String>>, ) -> Self
Creates a new UnsupportedOperator error.
The message for ErrorContext should describe why the operator is unsupported,
e.g., “‘=’ for types String and Number”.
Sourcepub fn parse_error(
message: impl Into<String>,
source: Option<Box<dyn Error + Send + Sync + 'static>>,
metadata: Option<HashMap<String, String>>,
) -> Self
pub fn parse_error( message: impl Into<String>, source: Option<Box<dyn Error + Send + Sync + 'static>>, metadata: Option<HashMap<String, String>>, ) -> Self
Creates a new ParseError error.
The message for ErrorContext should describe the parsing failure.
Trait Implementations§
Source§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
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 TraceableError for EvaluationError
impl TraceableError 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
§impl<T> Chain<T> for T
impl<T> Chain<T> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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