#[non_exhaustive]pub enum Error {
Show 44 variants
    TypeCheckFailure {
        tool_info: ToolInfo<'static>,
        argument: Value,
    },
    AssertEqualFailed {
        expected: Value,
        actual: Value,
    },
    AssertFailed,
    WrongColumnAmount {
        expected: usize,
        actual: usize,
    },
    ExpectedOperatorArgumentAmount {
        expected: usize,
        actual: usize,
    },
    ExpectedFunctionArgumentAmount {
        identifier: String,
        expected: usize,
        actual: usize,
    },
    ExpectedAtLeastFunctionArgumentAmount {
        identifier: String,
        minimum: usize,
        actual: usize,
    },
    ExpectedString {
        actual: Value,
    },
    ExpectedInt {
        actual: Value,
    },
    ExpectedFloat {
        actual: Value,
    },
    ExpectedNumber {
        actual: Value,
    },
    ExpectedNumberOrString {
        actual: Value,
    },
    ExpectedBoolean {
        actual: Value,
    },
    ExpectedList {
        actual: Value,
    },
    ExpectedFixedLenList {
        expected_len: usize,
        actual: Value,
    },
    ExpectedEmpty {
        actual: Value,
    },
    ExpectedMap {
        actual: Value,
    },
    ExpectedTable {
        actual: Value,
    },
    ExpectedFunction {
        actual: Value,
    },
    ExpectedCollection {
        actual: Value,
    },
    AppendedToLeafNode(Node),
    PrecedenceViolation,
    VariableIdentifierNotFound(String),
    FunctionIdentifierNotFound(String),
    TypeError {
        expected: &'static [ValueType],
        actual: Value,
    },
    MacroArgumentType {
        macro_info: ToolInfo<'static>,
        actual: Value,
    },
    WrongTypeCombination {
        operator: Operator,
        actual: Vec<ValueType>,
    },
    UnmatchedLBrace,
    UnmatchedRBrace,
    MissingOperatorOutsideOfBrace,
    UnmatchedPartialToken {
        first: PartialToken,
        second: Option<PartialToken>,
    },
    AdditionError {
        augend: Value,
        addend: Value,
    },
    SubtractionError {
        minuend: Value,
        subtrahend: Value,
    },
    NegationError {
        argument: Value,
    },
    MultiplicationError {
        multiplicand: Value,
        multiplier: Value,
    },
    DivisionError {
        dividend: Value,
        divisor: Value,
    },
    ModulationError {
        dividend: Value,
        divisor: Value,
    },
    InvalidRegex {
        regex: String,
        message: String,
    },
    ContextNotMutable,
    IllegalEscapeSequence(String),
    BuiltinFunctionsCannotBeEnabled,
    BuiltinFunctionsCannotBeDisabled,
    MacroFailure(String),
    CustomMessage(String),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TypeCheckFailure
Dust’s internal type checking failed to identify a type mismatch. This should never happen, /// the error prompts the user to report the bug.
AssertEqualFailed
The ‘assert’ macro did not resolve successfully.
AssertFailed
The ‘assert’ macro did not resolve successfully.
WrongColumnAmount
A row was inserted to a table with the wrong amount of values.
ExpectedOperatorArgumentAmount
An operator was called with the wrong amount of arguments.
ExpectedFunctionArgumentAmount
A function was called with the wrong amount of arguments.
ExpectedAtLeastFunctionArgumentAmount
A function was called with the wrong amount of arguments.
ExpectedString
ExpectedInt
ExpectedFloat
ExpectedNumber
An integer, floating point or value was expected.
ExpectedNumberOrString
An integer, floating point or string value was expected.
ExpectedBoolean
ExpectedList
ExpectedFixedLenList
ExpectedEmpty
ExpectedMap
ExpectedTable
ExpectedFunction
ExpectedCollection
A string, list, map or table value was expected.
AppendedToLeafNode(Node)
Tried to append a child to a leaf node. Leaf nodes cannot have children.
PrecedenceViolation
Tried to append a child to a node such that the precedence of the child is not higher. This error should never occur. If it does, please file a bug report.
VariableIdentifierNotFound(String)
A VariableIdentifier operation did not find its value in the context.
FunctionIdentifierNotFound(String)
A FunctionIdentifier operation did not find its value in the context.
TypeError
A value has the wrong type. Only use this if there is no other error that describes the expected and provided types in more detail.
MacroArgumentType
A macro or function was called with the wrong type of input.
WrongTypeCombination
Fields
An operator is used with a wrong combination of types.
UnmatchedLBrace
An opening brace without a matching closing brace was found.
UnmatchedRBrace
A closing brace without a matching opening brace was found.
MissingOperatorOutsideOfBrace
Left of an opening brace or right of a closing brace is a token that does not expect the brace next to it.
For example, writing 4(5) would yield this error, as the 4 does not have any operands.
UnmatchedPartialToken
Fields
first: PartialTokenThe unmatched partial token.
second: Option<PartialToken>The token that follows the unmatched partial token and that cannot be matched to the partial token, or None, if first is the last partial token in the stream.
A PartialToken is unmatched, such that it cannot be combined into a full Token.
This happens if for example a single = is found, surrounded by whitespace.
It is not a token, but it is part of the string representation of some tokens.
AdditionError
Fields
An addition operation performed by Rust failed.
SubtractionError
Fields
A subtraction operation performed by Rust failed.
NegationError
A negation operation performed by Rust failed.
MultiplicationError
Fields
A multiplication operation performed by Rust failed.
DivisionError
Fields
A division operation performed by Rust failed.
ModulationError
Fields
A modulation operation performed by Rust failed.
InvalidRegex
Fields
A regular expression could not be parsed
ContextNotMutable
A modification was attempted on a Context that does not allow modifications.
IllegalEscapeSequence(String)
An escape sequence within a string literal is illegal.
BuiltinFunctionsCannotBeEnabled
This context does not allow enabling builtin functions.
BuiltinFunctionsCannotBeDisabled
This context does not allow disabling builtin functions.
MacroFailure(String)
The function failed due to an external error.
CustomMessage(String)
A custom error explained by its message.
Implementations§
source§impl Error
 
impl Error
pub fn type_error(actual: Value, expected: &'static [ValueType]) -> Self
pub fn wrong_type_combination( operator: Operator, actual: Vec<ValueType> ) -> Self
pub fn expected_string(actual: Value) -> Self
pub fn expected_int(actual: Value) -> Self
pub fn expected_float(actual: Value) -> Self
pub fn expected_number(actual: Value) -> Self
pub fn expected_number_or_string(actual: Value) -> Self
pub fn expected_boolean(actual: Value) -> Self
pub fn expected_list(actual: Value) -> Self
pub fn expected_fixed_len_list(expected_len: usize, actual: Value) -> Self
pub fn expected_empty(actual: Value) -> Self
pub fn expected_map(actual: Value) -> Self
pub fn expected_table(actual: Value) -> Self
pub fn expected_function(actual: Value) -> Self
pub fn expected_collection(actual: Value) -> Self
sourcepub fn invalid_regex(regex: String, message: String) -> Self
 
pub fn invalid_regex(regex: String, message: String) -> Self
Constructs EvalexprError::InvalidRegex(regex)