[][src]Enum arithmetic_eval::EvalError

pub enum EvalError {
    TupleLenMismatch {
        lhs: LvalueLen,
        rhs: usize,
        context: TupleLenMismatchContext,
    },
    ArgsLenMismatch {
        def: LvalueLen,
        call: usize,
    },
    CannotDestructure,
    RepeatedAssignment {
        context: RepeatedAssignmentContext,
    },
    Undefined(String),
    CannotCall,
    NativeCall(String),
    UnexpectedOperand {
        op: Op,
    },
}

Errors that can occur during interpreting expressions and statements.

Variants

TupleLenMismatch

Mismatch between length of tuples in a binary operation or assignment.

Fields of TupleLenMismatch

lhs: LvalueLen

Length of a tuple on the left-hand side.

rhs: usize

Length of a tuple on the right-hand side.

context: TupleLenMismatchContext

Context in which the error has occurred.

ArgsLenMismatch

Mismatch between the number of arguments in the function definition and its call.

Fields of ArgsLenMismatch

def: LvalueLen

Number of args at the function definition.

call: usize

Number of args at the function call.

CannotDestructure

Cannot destructure a non-tuple variable.

RepeatedAssignment

Repeated assignment to the same variable in function args or tuple destructuring.

Fields of RepeatedAssignment

context: RepeatedAssignmentContext

Context in which the error has occurred.

Undefined(String)

Variable with the enclosed name is not defined.

CannotCall

Value is not callable (i.e., is not a function).

NativeCall(String)

Generic error during execution of a native function.

UnexpectedOperand

Unexpected operand type for the specified operation.

Fields of UnexpectedOperand

op: Op

Operation which failed.

Implementations

impl EvalError[src]

pub fn native(message: impl Into<String>) -> Self[src]

Creates a native error.

pub fn to_short_string(&self) -> String[src]

Returned shortened error cause.

pub fn main_span_info(&self) -> String[src]

Returns a short description of the spanned information.

pub fn help(&self) -> Option<String>[src]

Returns information helping fix the error.

Trait Implementations

impl Debug for EvalError[src]

impl Display for EvalError[src]

impl Error for EvalError[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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.