pub enum EvalErrorKind {
Show 16 variants
Other(String),
TypeMismatch {
expected: String,
found: String,
},
TypeMismatchArg {
arg: &'static str,
expected: String,
found: String,
},
CouldNotParse {
ty: &'static str,
value: String,
},
CouldNotConvertToNumber {
value: String,
},
ArrayIndexNegative {
index: f64,
},
ArrayIndexOutOfBounds {
index: f64,
max: usize,
},
ArrayIndexNotInteger {
index: f64,
},
InvalidRgba {
value: String,
reason: &'static str,
},
NotOrderedComparable {
op: String,
lhs: String,
rhs: String,
},
SearchNeedle {
found: String,
},
InterpolationOutputs,
MaxCallDepth {
op: String,
},
ZoomUnavailable,
Unimplemented {
op: String,
},
UnknownVariable {
name: String,
},
}Expand description
The semantic cause of an evaluation error.
Variants§
Other(String)
A message-only error: the user-thrown ["error", msg] operator, or a
parse error wrapped while compiling a user function body.
TypeMismatch
A value was not of the expected type.
TypeMismatchArg
Like TypeMismatch, but naming the offending
argument (e.g. "second argument") instead of the generic “value”.
CouldNotParse
A value could not be parsed into a type (to-color, coercions, …).
value is already rendered (raw string, else JSON.stringify).
CouldNotConvertToNumber
A value could not be converted to a number (to-number).
ArrayIndexNegative
An at index was negative.
ArrayIndexOutOfBounds
An at index was past the end of the array.
ArrayIndexNotInteger
An at index was not an integer.
InvalidRgba
An rgb/rgba/to-color array value was out of range or malformed.
reason is the clause after the value.
NotOrderedComparable
Ordered comparison of two runtime values of incompatible types.
SearchNeedle
An in/index-of needle was not a primitive.
InterpolationOutputs
An interpolation produced an uninterpolatable output at runtime.
MaxCallDepth
A user function recursed past the call-depth limit.
zoom used where no zoom is available.
Unimplemented
An operator MapLibre defines but this crate does not evaluate yet.
UnknownVariable
An unbound var reference at evaluation time.
Trait Implementations§
Source§impl Clone for EvalErrorKind
impl Clone for EvalErrorKind
Source§fn clone(&self) -> EvalErrorKind
fn clone(&self) -> EvalErrorKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EvalErrorKind
impl Debug for EvalErrorKind
Source§impl Display for EvalErrorKind
impl Display for EvalErrorKind
Source§impl PartialEq for EvalErrorKind
impl PartialEq for EvalErrorKind
Source§fn eq(&self, other: &EvalErrorKind) -> bool
fn eq(&self, other: &EvalErrorKind) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for EvalErrorKind
Auto Trait Implementations§
impl Freeze for EvalErrorKind
impl RefUnwindSafe for EvalErrorKind
impl Send for EvalErrorKind
impl Sync for EvalErrorKind
impl Unpin for EvalErrorKind
impl UnsafeUnpin for EvalErrorKind
impl UnwindSafe for EvalErrorKind
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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