Enum ExecutionError
#[non_exhaustive]pub enum ExecutionError {
Show 20 variants
InvalidArgumentCount {
expected: usize,
actual: usize,
},
UnsupportedTargetType {
target: Value,
},
NotSupportedAsMethod {
method: String,
target: Value,
},
UnsupportedKeyType(Value),
UnexpectedType {
got: String,
want: String,
},
NoSuchKey(Arc<String>),
UndeclaredReference(Arc<String>),
MissingArgumentOrTarget,
ValuesNotComparable(Value, Value),
UnsupportedUnaryOperator(&'static str, Value),
UnsupportedBinaryOperator(&'static str, Value, Value),
UnsupportedMapIndex(Value),
UnsupportedListIndex(Value),
UnsupportedIndex(Value, Value),
UnsupportedFunctionCallIdentifierType(IdedExpr),
UnsupportedFieldsConstruction(SelectExpr),
FunctionError {
function: String,
message: String,
},
DivisionByZero(Value),
RemainderByZero(Value),
Overflow(&'static str, Value, Value),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidArgumentCount
UnsupportedTargetType
NotSupportedAsMethod
UnsupportedKeyType(Value)
Indicates that the script attempted to use a value as a key in a map, but the type of the value was not supported as a key.
UnexpectedType
NoSuchKey(Arc<String>)
Indicates that the script attempted to reference a key on a type that was missing the requested key.
UndeclaredReference(Arc<String>)
Indicates that the script attempted to reference an undeclared variable method, or function.
MissingArgumentOrTarget
Indicates that a function expected to be called as a method, or to be called with at least one parameter.
ValuesNotComparable(Value, Value)
Indicates that a comparison could not be performed.
UnsupportedUnaryOperator(&'static str, Value)
Indicates that an operator was used on a type that does not support it.
UnsupportedBinaryOperator(&'static str, Value, Value)
Indicates that an unsupported binary operator was applied on two values where it’s unsupported, for example list + map.
UnsupportedMapIndex(Value)
Indicates that an unsupported type was used to index a map
UnsupportedListIndex(Value)
Indicates that an unsupported type was used to index a list
UnsupportedIndex(Value, Value)
Indicates that an unsupported type was used to index a list
UnsupportedFunctionCallIdentifierType(IdedExpr)
Indicates that a function call occurred without an [Expression::Ident]
as the function identifier.
UnsupportedFieldsConstruction(SelectExpr)
Indicates that a [Member::Fields] construction was attempted
which is not yet supported.
FunctionError
Indicates that a function had an error during execution.
DivisionByZero(Value)
RemainderByZero(Value)
Overflow(&'static str, Value, Value)
Implementations§
§impl ExecutionError
impl ExecutionError
pub fn no_such_key(name: &str) -> ExecutionError
pub fn undeclared_reference(name: &str) -> ExecutionError
pub fn invalid_argument_count(expected: usize, actual: usize) -> ExecutionError
pub fn function_error<E>(function: &str, error: E) -> ExecutionErrorwhere
E: ToString,
pub fn unsupported_target_type(target: Value) -> ExecutionError
pub fn not_supported_as_method(method: &str, target: Value) -> ExecutionError
pub fn unsupported_key_type(value: Value) -> ExecutionError
pub fn missing_argument_or_target() -> ExecutionError
Trait Implementations§
§impl Clone for ExecutionError
impl Clone for ExecutionError
§fn clone(&self) -> ExecutionError
fn clone(&self) -> ExecutionError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ExecutionError
impl Debug for ExecutionError
§impl Display for ExecutionError
impl Display for ExecutionError
§impl Error for ExecutionError
impl Error for ExecutionError
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
§impl From<ExecutionError> for Result<Value, ExecutionError>
impl From<ExecutionError> for Result<Value, ExecutionError>
§fn from(value: ExecutionError) -> Result<Value, ExecutionError>
fn from(value: ExecutionError) -> Result<Value, ExecutionError>
§impl PartialEq for ExecutionError
impl PartialEq for ExecutionError
impl StructuralPartialEq for ExecutionError
Auto Trait Implementations§
impl Freeze for ExecutionError
impl RefUnwindSafe for ExecutionError
impl Send for ExecutionError
impl Sync for ExecutionError
impl Unpin for ExecutionError
impl UnwindSafe for ExecutionError
Blanket Implementations§
§impl<T> AnyExt for T
impl<T> AnyExt for T
§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
T behind reference§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
T behind mutable reference§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
T behind Rc pointer§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
T behind Arc pointer§fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
fn downcast_box<T>(this: Box<Self>) -> Result<Box<T>, Box<Self>>where
T: Any,
T behind Box pointer§fn downcast_move<T>(this: Self) -> Option<T>
fn downcast_move<T>(this: Self) -> Option<T>
Self to T,
useful only in generic context as a workaround for specializationSource§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,
§impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for Xwhere
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X>) -> Box<T>
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut 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> 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