pub enum ParseErrorKind {
Show 55 variants
Other(String),
UnknownExpression(String),
WrongArgCount {
op: String,
expected: String,
found: usize,
},
TypeMismatch {
expected: String,
found: String,
},
NotComparable {
op: String,
ty: String,
},
CannotCompare {
lhs: String,
rhs: String,
},
NotInterpolatable(String),
UnboundVariable(String),
Zoom(&'static str),
RequiresExactlyOneArg {
op: String,
found: usize,
},
ExpectedOneArgument,
ExpectedArgsOfType {
sig: String,
found: String,
},
MatchAtLeast4 {
found: usize,
},
ArrayItemType,
ArrayLength,
BareObject,
EmptyArray,
ExpressionNameNotString {
found: &'static str,
},
GlobalStateProperty {
found: String,
},
AscendingStops {
kind: String,
},
ExponentialBase,
CubicBezier,
CollatorOptions,
NumberFormatExclusive,
SliceFirstArg {
found: String,
},
SearchNeedle {
found: String,
},
BranchLabelsType,
BranchLabelsUnique,
BranchLabelsEmpty,
BranchLabelNotInteger,
BranchLabelTooLarge,
GeojsonPolygon {
op: String,
},
LetBindingNameString,
VarBindingName,
NumberFormatOptionsObject,
VerticalAlign {
found: String,
},
ExpectedEvenArgs {
op: &'static str,
},
ExpectedOddArgsCase,
ExpectedOddArgsLet,
FormatAtLeastOne,
CollatorOneArg,
NumberFormatTwoArgs,
ExpectedNArgs {
n: usize,
found: usize,
},
FormatFirstSection,
ExtArgCount {
kind: &'static str,
op: String,
expected: usize,
found: usize,
},
MacroDepth {
op: String,
},
InterpolationStopNumber,
StepStopNumber,
InterpolationTypeArray,
InterpolationTypeName,
UnknownInterpolationType {
name: String,
},
CollatorNonString,
ExpectedStringOrArray {
found: String,
},
FormattedTextType,
VariableName,
}Expand description
The semantic cause of a parse/compile error.
Variants§
Other(String)
A wrapped runtime error surfaced by compile-time constant folding. (Every intrinsic parse error has a dedicated variant below.)
UnknownExpression(String)
An unrecognized operator name.
WrongArgCount
Wrong number of arguments to an operator (expected is a human range).
TypeMismatch
An expression’s type did not satisfy the expected type.
NotComparable
A comparison operator applied to an unsupported operand type.
CannotCompare
A comparison between two incompatible concrete types.
NotInterpolatable(String)
An interpolate output whose type cannot be interpolated.
UnboundVariable(String)
An unbound var reference.
Zoom(&'static str)
Misuse of the zoom expression.
RequiresExactlyOneArg
An operator that takes exactly one argument (literal/within/…).
ExpectedOneArgument
A single-argument coercion (to-boolean/to-string) with wrong arity.
ExpectedArgsOfType
A CompoundExpression whose arity matched no typed overload.
MatchAtLeast4
match with fewer than four arguments.
ArrayItemType
The first (item-type) argument of array was not a valid type name.
ArrayLength
The length argument of array was not a positive integer literal.
BareObject
A bare object used where an expression was expected.
EmptyArray
An empty array (no operator).
ExpressionNameNotString
The operator slot was not a string. found is the JS typeof.
GlobalStateProperty
The global-state property argument was not a string. found is a type.
AscendingStops
step/interpolate stop inputs were not strictly ascending.
ExponentialBase
exponential interpolation without a numeric base.
CubicBezier
A malformed cubic-bezier interpolation type.
CollatorOptions
The collator options argument was not an object.
NumberFormatExclusive
number-format given both currency and unit.
SliceFirstArg
slice’s first argument was not an array or string.
SearchNeedle
An in/index-of needle (checked statically) was not a primitive.
BranchLabelsType
A match branch label was not a number or string.
BranchLabelsUnique
Duplicate match branch labels.
BranchLabelsEmpty
A match branch with no labels.
BranchLabelNotInteger
A non-integer numeric match branch label.
BranchLabelTooLarge
A numeric match branch label beyond the safe-integer range.
GeojsonPolygon
A within/distance argument was not valid polygon geojson.
LetBindingNameString
A let binding name was not a string.
VarBindingName
A var binding name was not a string.
NumberFormatOptionsObject
The number-format options argument was not an object.
VerticalAlign
A format vertical-align option had an invalid value.
ExpectedEvenArgs
match/step/interpolate given an odd number of arguments.
ExpectedOddArgsCase
case given an even number of arguments.
ExpectedOddArgsLet
let given an even number of arguments.
FormatAtLeastOne
format given no sections.
CollatorOneArg
collator given other than one argument.
NumberFormatTwoArgs
number-format given other than two arguments.
ExpectedNArgs
An operator taking a fixed count other than one, with wrong arity.
FormatFirstSection
A format first argument that was a bare options object.
ExtArgCount
A user macro/function/native call with the wrong argument count.
MacroDepth
A macro expanded past the recursion-depth limit.
InterpolationStopNumber
An interpolate stop input was not a number literal.
StepStopNumber
A step stop input was not a number literal.
InterpolationTypeArray
An interpolation type was not an array (e.g. ["linear"]).
InterpolationTypeName
An interpolation type name was not a string.
UnknownInterpolationType
An unrecognized interpolation type.
CollatorNonString
A collator compared non-string operands.
ExpectedStringOrArray
slice/concat argument was not a string or array.
FormattedTextType
A format section’s text was not a valid formatted type.
VariableName
A let variable name contained invalid characters.
Trait Implementations§
Source§impl Clone for ParseErrorKind
impl Clone for ParseErrorKind
Source§fn clone(&self) -> ParseErrorKind
fn clone(&self) -> ParseErrorKind
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 ParseErrorKind
impl Debug for ParseErrorKind
Source§impl Display for ParseErrorKind
impl Display for ParseErrorKind
Source§impl PartialEq for ParseErrorKind
impl PartialEq for ParseErrorKind
Source§fn eq(&self, other: &ParseErrorKind) -> bool
fn eq(&self, other: &ParseErrorKind) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ParseErrorKind
Auto Trait Implementations§
impl Freeze for ParseErrorKind
impl RefUnwindSafe for ParseErrorKind
impl Send for ParseErrorKind
impl Sync for ParseErrorKind
impl Unpin for ParseErrorKind
impl UnsafeUnpin for ParseErrorKind
impl UnwindSafe for ParseErrorKind
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