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
impl EvalexprError
[src]
impl EvalexprError
[src]pub fn type_error(actual: Value, expected: Vec<ValueType>) -> Self
[src]
pub fn type_error(actual: Value, expected: Vec<ValueType>) -> Self
[src]Constructs EvalexprError::TypeError{actual, expected}
.
pub fn wrong_type_combination(
operator: Operator,
actual: Vec<ValueType>
) -> Self
[src]
pub fn wrong_type_combination(
operator: Operator,
actual: Vec<ValueType>
) -> Self
[src]Constructs EvalexprError::WrongTypeCombination{operator, actual}
.
pub fn expected_string(actual: Value) -> Self
[src]
pub fn expected_string(actual: Value) -> Self
[src]Constructs EvalexprError::ExpectedString{actual}
.
pub fn expected_int(actual: Value) -> Self
[src]
pub fn expected_int(actual: Value) -> Self
[src]Constructs EvalexprError::ExpectedInt{actual}
.
pub fn expected_float(actual: Value) -> Self
[src]
pub fn expected_float(actual: Value) -> Self
[src]Constructs EvalexprError::ExpectedFloat{actual}
.
pub fn expected_number(actual: Value) -> Self
[src]
pub fn expected_number(actual: Value) -> Self
[src]Constructs EvalexprError::ExpectedNumber{actual}
.
pub fn expected_number_or_string(actual: Value) -> Self
[src]
pub fn expected_number_or_string(actual: Value) -> Self
[src]Constructs EvalexprError::ExpectedNumberOrString{actual}
.
pub fn expected_boolean(actual: Value) -> Self
[src]
pub fn expected_boolean(actual: Value) -> Self
[src]Constructs EvalexprError::ExpectedBoolean{actual}
.
pub fn expected_tuple(actual: Value) -> Self
[src]
pub fn expected_tuple(actual: Value) -> Self
[src]Constructs EvalexprError::ExpectedTuple{actual}
.
pub fn expected_fixed_len_tuple(expected_len: usize, actual: Value) -> Self
[src]
pub fn expected_fixed_len_tuple(expected_len: usize, actual: Value) -> Self
[src]Constructs EvalexprError::ExpectedFixedLenTuple{expected_len, actual}
.
pub fn expected_empty(actual: Value) -> Self
[src]
pub fn expected_empty(actual: Value) -> Self
[src]Constructs EvalexprError::ExpectedEmpty{actual}
.
pub fn invalid_regex(regex: String, message: String) -> Self
[src]
pub fn invalid_regex(regex: String, message: String) -> Self
[src]Constructs EvalexprError::InvalidRegex(regex)
Trait Implementations
impl Debug for EvalexprError
[src]
impl Debug for EvalexprError
[src]impl Display for EvalexprError
[src]
impl Display for EvalexprError
[src]impl Error for EvalexprError
[src]
impl Error for EvalexprError
[src]fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]The lower-level source of this error, if any. Read more
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
fn description(&self) -> &str
1.0.0[src]
fn description(&self) -> &str
1.0.0[src]use the Display impl or to_string()
impl PartialEq<EvalexprError> for EvalexprError
[src]
impl PartialEq<EvalexprError> for EvalexprError
[src]fn eq(&self, other: &EvalexprError) -> bool
[src]
fn eq(&self, other: &EvalexprError) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &EvalexprError) -> bool
[src]
fn ne(&self, other: &EvalexprError) -> bool
[src]This method tests for !=
.
impl StructuralPartialEq for EvalexprError
[src]
Auto Trait Implementations
impl RefUnwindSafe for EvalexprError
impl Send for EvalexprError
impl Sync for EvalexprError
impl Unpin for EvalexprError
impl UnwindSafe for EvalexprError
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more