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

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

ArityError

Error in arity to function call

Fields of ArityError

name: Option<Name>

Name of function, if available

expected: Arity

Expected count or range of arguments

found: u32

Number of arguments present

CompareNaN

Attempt to compare with a NaN Float value.

CannotCompare(&'static str)

Type does not support ordered comparison

CannotDefine(Name)

Attempt to redefine a name in master scope

DivideByZero

Attempt to divide by a number equal to zero.

DuplicateField(Name)

Duplicate field name in struct definition

DuplicateKeyword(Name)

Duplicate keyword argument to function

DuplicateStructDef(Name)

Duplicate struct definition

FieldError

No such field name in struct

Fields of FieldError

struct_name: Name

Name of struct type

field: Name

Field name

FieldTypeError

Type error assigning value to field

Fields of FieldTypeError

struct_name: Name

Name of struct type

field: Name

Name of field

expected: Name

Expected type name

found: &'static str

Name of type received

value: Option<Value>

Value received

FormatError

Error in format call

Fields of FormatError

fmt: Box<str>

Supplied format string

span: Span

Span within format string

err: FormatError

Formatting error produced

InvalidClosureValue(u32)

Invalid index into closure values

InvalidConst(u32)

Invalid const index

InvalidDepth

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

InvalidJump(u32)

Invalid jump label

InvalidSlice(usizeusize)

Slice indices out of order

InvalidStack(u32)

Invalid stack index

InvalidSystemFn(u32)

Invalid system function

MissingArgCount(Name)

CallSys instruction for system function which requires argument count

MissingField

Attempt to construct a Struct without the given field

Fields of MissingField

struct_name: Name

Struct type name

field: Name

Field name

NameError(Name)

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

NotCharBoundary(usize)

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

OddKeywordParams

Odd number of parameters when keyword-value pairs expected

OutOfBounds(usize)

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

Overflow

Integer overflow during certain arithmetic operations.

Panic(Option<Value>)

Code called panic

StructDefError(Name)

Struct definition not found

TypeError

Operation performed on unexpected type

Fields of TypeError

expected: &'static str

Name of the type expected

found: &'static str

Name of the type received

value: Option<Value>

Value received

StructMismatch

Function received a value of incorrect type

Fields of StructMismatch

lhs: Name

Type of left-hand side value

rhs: Name

Type of right-hand side value

TypeMismatch

Attempt to operate on two values of incompatible types

Fields of TypeMismatch

lhs: &'static str

Type of left-hand side value

rhs: &'static str

Type of right-hand side value

UnexpectedEnd

Unexpected end in bytecode

UnrecognizedKeyword(Name)

Unrecognized keyword passed to function

UnrecognizedOpCode(u8)

Unrecognized opcode

Methods

impl ExecError[src]

pub fn expected(expected: &'static str, v: &Value) -> ExecError[src]

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

pub fn expected_field(
    struct_name: Name,
    field: Name,
    expected: Name,
    v: &Value
) -> ExecError
[src]

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

Trait Implementations

impl Debug for ExecError[src]

impl Display for ExecError[src]

impl Error for ExecError[src]

impl From<ExecError> for Error[src]

impl NameDisplay for ExecError[src]

Auto Trait Implementations

impl !RefUnwindSafe for ExecError

impl !Send for ExecError

impl !Sync for ExecError

impl Unpin for ExecError

impl !UnwindSafe for ExecError

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,