Enum evalexpr::error::EvalexprError [−][src]
pub enum EvalexprError {}Show variants
WrongOperatorArgumentAmount { expected: usize, actual: usize, }, WrongFunctionArgumentAmount { expected: usize, actual: usize, }, ExpectedString { actual: Value, }, ExpectedInt { actual: Value, }, ExpectedFloat { actual: Value, }, ExpectedNumber { actual: Value, }, ExpectedNumberOrString { actual: Value, }, ExpectedBoolean { actual: Value, }, ExpectedTuple { actual: Value, }, ExpectedFixedLenTuple { expected_len: usize, actual: Value, }, ExpectedEmpty { actual: Value, }, AppendedToLeafNode, PrecedenceViolation, VariableIdentifierNotFound(String), FunctionIdentifierNotFound(String), TypeError { expected: Vec<ValueType>, actual: Value, }, WrongTypeCombination { operator: Operator, actual: Vec<ValueType>, }, UnmatchedLBrace, UnmatchedRBrace, 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), CustomMessage(String),
Expand description
Errors used in this crate.
Variants
An operator was called with a wrong amount of arguments.
Show fields
A function was called with a wrong amount of arguments.
Show fields
A string value was expected.
Show fields
Fields of ExpectedString
actual: Value
The actual value.
An integer value was expected.
Show fields
Fields of ExpectedInt
actual: Value
The actual value.
A float value was expected.
Show fields
Fields of ExpectedFloat
actual: Value
The actual value.
A numeric value was expected.
Numeric values are the variants Value::Int
and Value::Float
.
Show fields
Fields of ExpectedNumber
actual: Value
The actual value.
A numeric or string value was expected.
Numeric values are the variants Value::Int
and Value::Float
.
Show fields
Fields of ExpectedNumberOrString
actual: Value
The actual value.
A boolean value was expected.
Show fields
Fields of ExpectedBoolean
actual: Value
The actual value.
A tuple value was expected.
Show fields
Fields of ExpectedTuple
actual: Value
The actual value.
A tuple value of a certain length was expected.
Show fields
An empty value was expected.
Show fields
Fields of ExpectedEmpty
actual: Value
The actual value.
Tried to append a child to a leaf node. Leaf nodes cannot have children.
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.
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.
Show fields
An operator is used with a wrong combination of types.
Show fields
An opening brace without a matching closing brace was found.
A closing brace without a matching opening brace was found.
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.
Show fields
Fields of UnmatchedPartialToken
first: PartialToken
The 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.
An addition operation performed by Rust failed.
Show fields
A subtraction operation performed by Rust failed.
Show fields
A negation operation performed by Rust failed.
Show fields
Fields of NegationError
argument: Value
The argument of the negation.
A multiplication operation performed by Rust failed.
Show fields
A division operation performed by Rust failed.
Show fields
A modulation operation performed by Rust failed.
Show fields
A regular expression could not be parsed
Show fields
A modification was attempted on a Context
that does not allow modifications.
IllegalEscapeSequence(String)
An escape sequence within a string literal is illegal.
CustomMessage(String)
A custom error explained by its message.
Implementations
Constructs EvalexprError::TypeError{actual, expected}
.
Constructs EvalexprError::WrongTypeCombination{operator, actual}
.
Constructs EvalexprError::ExpectedString{actual}
.
Constructs EvalexprError::ExpectedInt{actual}
.
Constructs EvalexprError::ExpectedFloat{actual}
.
Constructs EvalexprError::ExpectedNumber{actual}
.
Constructs EvalexprError::ExpectedNumberOrString{actual}
.
Constructs EvalexprError::ExpectedBoolean{actual}
.
Constructs EvalexprError::ExpectedTuple{actual}
.
Constructs EvalexprError::ExpectedFixedLenTuple{expected_len, actual}
.
Constructs EvalexprError::ExpectedEmpty{actual}
.
Constructs EvalexprError::InvalidRegex(regex)
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for EvalexprError
impl Send for EvalexprError
impl Sync for EvalexprError
impl Unpin for EvalexprError
impl UnwindSafe for EvalexprError