Enum ketos::exec::ExecError [] [src]

pub enum ExecError {
    ArityError {
        name: Option<Name>,
        expected: Arity,
        found: u32,
    },
    CompareNaN,
    CannotCompare(&'static str),
    CannotDefine(Name),
    DivideByZero,
    DuplicateField(Name),
    DuplicateKeyword(Name),
    DuplicateStructDef(Name),
    FieldError {
        struct_name: Name,
        field: Name,
    },
    FieldTypeError {
        struct_name: Name,
        field: Name,
        expected: Name,
        found: &'static str,
        value: Option<Value>,
    },
    FormatError {
        fmt: Box<str>,
        span: Span,
        err: FormatError,
    },
    InvalidClosureValue(u32),
    InvalidConst(u32),
    InvalidDepth,
    InvalidJump(u32),
    InvalidSlice(usizeusize),
    InvalidStack(u32),
    InvalidSystemFn(u32),
    MissingArgCount(Name),
    MissingField {
        struct_name: Name,
        field: Name,
    },
    NameError(Name),
    NotCharBoundary(usize),
    OddKeywordParams,
    OutOfBounds(usize),
    Overflow,
    Panic(Option<Value>),
    StructDefError(Name),
    TypeError {
        expected: &'static str,
        found: &'static str,
        value: Option<Value>,
    },
    StructMismatch {
        lhs: Name,
        rhs: Name,
    },
    TypeMismatch {
        lhs: &'static str,
        rhs: &'static str,
    },
    UnexpectedEnd,
    UnrecognizedKeyword(Name),
    UnrecognizedOpCode(u8),
}

Represents an error generated while executing bytecode.

Variants

Error in arity to function call

Fields of ArityError

Name of function, if available

Expected count or range of arguments

Number of arguments present

Attempt to compare with a NaN Float value.

Type does not support ordered comparison

Attempt to redefine a name in master scope

Attempt to divide by a number equal to zero.

Duplicate field name in struct definition

Duplicate keyword argument to function

Duplicate struct definition

No such field name in struct

Fields of FieldError

Name of struct type

Field name

Type error assigning value to field

Fields of FieldTypeError

Name of struct type

Name of field

Expected type name

Name of type received

Value received

Error in format call

Fields of FormatError

Supplied format string

Span within format string

Formatting error produced

Invalid index into closure values

Invalid const index

Invalid (zero) depth value to Quote, Quasiquote, or Comma instruction

Invalid jump label

Slice indices out of order

Invalid stack index

Invalid system function

CallSys instruction for system function which requires argument count

Attempt to construct a Struct without the given field

Fields of MissingField

Struct type name

Field name

Attempt to lookup a name that did not exist in scope.

Attempt to slice a string not along UTF-8 code point boundaries.

Odd number of parameters when keyword-value pairs expected

Attempt to access an element in a list that is out of bounds.

Integer overflow during certain arithmetic operations.

Code called panic

Struct definition not found

Operation performed on unexpected type

Fields of TypeError

Name of the type expected

Name of the type received

Value received

Function received a value of incorrect type

Fields of StructMismatch

Type of left-hand side value

Type of right-hand side value

Attempt to operate on two values of incompatible types

Fields of TypeMismatch

Type of left-hand side value

Type of right-hand side value

Unexpected end in bytecode

Unrecognized keyword passed to function

Unrecognized opcode

Methods

impl ExecError
[src]

Convenience function to return a TypeError value when expected type is expected, but some other type of value is found.

Convenience function to return a FieldTypeError value when a struct field of the incorrect type is received.

Trait Implementations

impl Debug for ExecError
[src]

Formats the value using the given formatter.

impl StdError for ExecError
[src]

A short description of the error. Read more

The lower-level cause of this error, if any. Read more

impl Display for ExecError
[src]

Formats the value using the given formatter. Read more

impl NameDisplay for ExecError
[src]

Writes the value's display representation to the formatter stream.