[][src]Enum evalexpr::error::EvalexprError

pub enum EvalexprError {
    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,
    },
    ContextNotManipulable,
    IllegalEscapeSequence(String),
    CustomMessage(String),
}

Errors used in this crate.

Variants

WrongOperatorArgumentAmount

An operator was called with a wrong amount of arguments.

Fields of WrongOperatorArgumentAmount

expected: usize

The expected amount of arguments.

actual: usize

The actual amount of arguments.

WrongFunctionArgumentAmount

A function was called with a wrong amount of arguments.

Fields of WrongFunctionArgumentAmount

expected: usize

The expected amount of arguments.

actual: usize

The actual amount of arguments.

ExpectedString

A string value was expected.

Fields of ExpectedString

actual: Value

The actual value.

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.

ExpectedNumberOrString

A numeric or string value was expected. Numeric values are the variants Value::Int and Value::Float.

Fields of ExpectedNumberOrString

actual: Value

The actual value.

ExpectedBoolean

A boolean value was expected.

Fields of ExpectedBoolean

actual: Value

The actual value.

ExpectedTuple

A tuple value was expected.

Fields of ExpectedTuple

actual: Value

The actual value.

ExpectedFixedLenTuple

A tuple value of a certain length was expected.

Fields of ExpectedFixedLenTuple

expected_len: usize

The expected len

actual: Value

The actual value.

ExpectedEmpty

An empty value was expected.

Fields of ExpectedEmpty

actual: Value

The actual value.

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. 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.

Fields of TypeError

expected: Vec<ValueType>

The expected types.

actual: Value

The actual value.

WrongTypeCombination

An operator is used with a wrong combination of types.

Fields of WrongTypeCombination

operator: Operator

The operator that whose evaluation caused the error.

actual: Vec<ValueType>

The types that were used in the operator causing it to fail.

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

augend: Value

The first argument of the addition.

addend: Value

The second argument of the addition.

SubtractionError

A subtraction operation performed by Rust failed.

Fields of SubtractionError

minuend: Value

The first argument of the subtraction.

subtrahend: Value

The second argument of the subtraction.

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

multiplicand: Value

The first argument of the multiplication.

multiplier: Value

The second argument of the multiplication.

DivisionError

A division operation performed by Rust failed.

Fields of DivisionError

dividend: Value

The first argument of the division.

divisor: Value

The second argument of the division.

ModulationError

A modulation operation performed by Rust failed.

Fields of ModulationError

dividend: Value

The first argument of the modulation.

divisor: Value

The second argument of the modulation.

InvalidRegex

A regular expression could not be parsed

Fields of InvalidRegex

regex: String

The invalid regular expression

message: String

Failure message from the regex engine

ContextNotManipulable

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.

Methods

impl EvalexprError[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]

Constructs EvalexprError::WrongTypeCombination{operator, actual}.

pub fn expected_string(actual: Value) -> Self[src]

Constructs EvalexprError::ExpectedString{actual}.

pub fn expected_int(actual: Value) -> Self[src]

Constructs EvalexprError::ExpectedInt{actual}.

pub fn expected_float(actual: Value) -> Self[src]

Constructs EvalexprError::ExpectedFloat{actual}.

pub fn expected_number(actual: Value) -> Self[src]

Constructs EvalexprError::ExpectedNumber{actual}.

pub fn expected_number_or_string(actual: Value) -> Self[src]

Constructs EvalexprError::ExpectedNumberOrString{actual}.

pub fn expected_boolean(actual: Value) -> Self[src]

Constructs EvalexprError::ExpectedBoolean{actual}.

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]

Constructs EvalexprError::ExpectedFixedLenTuple{expected_len, actual}.

pub fn expected_empty(actual: Value) -> Self[src]

Constructs EvalexprError::ExpectedEmpty{actual}.

pub fn invalid_regex(regex: String, message: String) -> Self[src]

Constructs EvalexprError::InvalidRegex(regex)

Trait Implementations

impl PartialEq<EvalexprError> for EvalexprError[src]

impl Debug for EvalexprError[src]

impl Display for EvalexprError[src]

impl Error for EvalexprError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]