[−][src]Enum evalexpr::error::Error
Errors used in this crate.
Variants
WrongOperatorArgumentAmount
An operator was called with a wrong amount of arguments.
Fields of WrongOperatorArgumentAmount
WrongFunctionArgumentAmount
A function was called with a wrong amount of arguments.
Fields of WrongFunctionArgumentAmount
ExpectedInt
An integer value was expected.
Fields of ExpectedInt
actual: Value
The actual value.
ExpectedFloat
A float value was expected.
Fields of ExpectedFloat
actual: Value
The actual value.
ExpectedNumber
A numeric value was expected.
Numeric values are the variants Value::Int
and Value::Float
.
Fields of ExpectedNumber
actual: Value
The actual value.
ExpectedBoolean
A boolean value was expected.
Fields of ExpectedBoolean
actual: Value
The actual value.
EmptyExpression
The given expression is empty
EvaluatedRootNode
Tried to evaluate the root node. The root node should only be used as dummy node.
AppendedToLeafNode
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.
VariableIdentifierNotFound(String)
A VariableIdentifier
operation did not find its value in the configuration.
FunctionIdentifierNotFound(String)
A FunctionIdentifier
operation did not find its value in the configuration.
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.
Fields of TypeError
UnmatchedLBrace
An opening brace without a matching closing brace was found.
UnmatchedRBrace
A closing brace without a matching opening brace was found.
UnmatchedPartialToken
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.
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.
AdditionError
An addition operation performed by Rust failed.
Fields of AdditionError
SubtractionError
A subtraction operation performed by Rust failed.
Fields of SubtractionError
NegationError
A negation operation performed by Rust failed.
Fields of NegationError
argument: Value
The argument of the negation.
MultiplicationError
A multiplication operation performed by Rust failed.
Fields of MultiplicationError
DivisionError
A division operation performed by Rust failed.
Fields of DivisionError
ModulationError
A modulation operation performed by Rust failed.
Fields of ModulationError
Methods
impl Error
[src]
pub fn type_error(actual: Value, expected: Vec<Value>) -> Self
[src]
Constructs Error::TypeError{actual, expected}
.
pub fn expected_int(actual: Value) -> Self
[src]
Constructs Error::ExpectedInt(actual)
.
pub fn expected_float(actual: Value) -> Self
[src]
Constructs Error::ExpectedFloat(actual)
.
pub fn expected_number(actual: Value) -> Self
[src]
Constructs Error::ExpectedNumber(actual)
.
pub fn expected_boolean(actual: Value) -> Self
[src]
Constructs Error::ExpectedBoolean(actual)
.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,