[][src]Enum runestick::VmErrorKind

pub enum VmErrorKind {
    Unwound {
        kind: Box<VmErrorKind>,
        unit: Arc<Unit>,
        ip: usize,
    },
    Panic {
        reason: Panic,
    },
    NoRunningVm,
    Halted {
        halt: VmHaltInfo,
    },
    FormatError,
    StackError {
        error: StackError,
    },
    Overflow,
    Underflow,
    DivideByZero,
    MissingFunction {
        hash: Hash,
    },
    MissingInstanceFunction {
        hash: Hash,
        instance: ValueTypeInfo,
    },
    IpOutOfBounds,
    UnsupportedAwait {
        actual: ValueTypeInfo,
    },
    UnsupportedBinaryOperation {
        op: &'static str,
        lhs: ValueTypeInfo,
        rhs: ValueTypeInfo,
    },
    UnsupportedUnaryOperation {
        op: &'static str,
        operand: ValueTypeInfo,
    },
    MissingProtocol {
        protocol: Protocol,
        actual: ValueTypeInfo,
    },
    MissingStaticString {
        slot: usize,
    },
    MissingStaticObjectKeys {
        slot: usize,
    },
    BadArgumentCount {
        actual: usize,
        expected: usize,
    },
    BadArgumentType {
        arg: usize,
        expected: ValueTypeInfo,
        actual: ValueTypeInfo,
    },
    BadArgument {
        error: VmError,
        arg: usize,
        to: &'static str,
    },
    BadReturn {
        error: VmError,
        ret: &'static str,
    },
    UnsupportedIndexSet {
        target: ValueTypeInfo,
        index: ValueTypeInfo,
        value: ValueTypeInfo,
    },
    UnsupportedIndexGet {
        target: ValueTypeInfo,
        index: ValueTypeInfo,
    },
    UnsupportedTupleIndexGet {
        target: ValueTypeInfo,
    },
    UnsupportedTupleIndexSet {
        target: ValueTypeInfo,
    },
    UnsupportedObjectSlotIndexGet {
        target: ValueTypeInfo,
    },
    UnsupportedIs {
        value: ValueTypeInfo,
        test_type: ValueTypeInfo,
    },
    UnsupportedCallFn {
        actual_type: ValueTypeInfo,
    },
    ObjectIndexMissing {
        slot: usize,
    },
    MissingIndex {
        target: ValueTypeInfo,
        index: Integer,
    },
    MissingField {
        target: ValueTypeInfo,
        field: String,
    },
    UnsupportedUnwrap {
        actual: ValueTypeInfo,
    },
    UnsupportedUnwrapNone,
    UnsupportedUnwrapErr {
        err: ValueTypeInfo,
    },
    UnsupportedIsValueOperand {
        actual: ValueTypeInfo,
    },
    GeneratorComplete,
    AccessError {
        error: AccessError,
    },
    Expected {
        expected: ValueTypeInfo,
        actual: ValueTypeInfo,
    },
    ExpectedAny {
        actual: ValueTypeInfo,
    },
    ValueToIntegerCoercionError {
        from: Integer,
        to: &'static str,
    },
    IntegerToValueCoercionError {
        from: Integer,
        to: &'static str,
    },
    ExpectedTupleLength {
        actual: usize,
        expected: usize,
    },
    IterationError,
}

The kind of error encountered.

Variants

Unwound

A vm error that was propagated from somewhere else.

In order to represent this, we need to preserve the instruction pointer and eventually unit from where the error happened.

Fields of Unwound

kind: Box<VmErrorKind>

The wrapper error.

unit: Arc<Unit>

Associated unit.

ip: usize

The instruction pointer of where the original error happened.

Panic

The virtual machine panicked for a specific reason.

Fields of Panic

reason: Panic

The reason for the panic.

NoRunningVm

Raised when we try to access an empty execution.

Halted

The virtual machine stopped for an unexpected reason.

Fields of Halted

halt: VmHaltInfo

The reason why the virtual machine stopped.

FormatError

Error raised when external format function results in error.

StackError

Error raised when interacting with the stack.

Fields of StackError

error: StackError

The source error.

Overflow

The virtual machine encountered a numerical overflow.

Underflow

The virtual machine encountered a numerical underflow.

DivideByZero

The virtual machine encountered a divide-by-zero.

MissingFunction

Failure to lookup function.

Fields of MissingFunction

hash: Hash

Hash of function to look up.

MissingInstanceFunction

Failure to lookup instance function.

Fields of MissingInstanceFunction

hash: Hash

Hash of function to look up.

instance: ValueTypeInfo

The instance type we tried to look up function on.

IpOutOfBounds

Instruction pointer went out-of-bounds.

UnsupportedAwait

Tried to await something on the stack which can't be await:ed.

Fields of UnsupportedAwait

actual: ValueTypeInfo

The actual target.

UnsupportedBinaryOperation

Unsupported binary operation.

Fields of UnsupportedBinaryOperation

op: &'static str

Operation.

lhs: ValueTypeInfo

Left-hand side operator.

rhs: ValueTypeInfo

Right-hand side operator.

UnsupportedUnaryOperation

Unsupported unary operation.

Fields of UnsupportedUnaryOperation

op: &'static str

Operation.

operand: ValueTypeInfo

Operand.

MissingProtocol

Protocol not implemented on type.

Fields of MissingProtocol

protocol: Protocol

The missing protocol.

actual: ValueTypeInfo

The encountered argument.

MissingStaticString

Indicates that a static string is missing for the given slot.

Fields of MissingStaticString

slot: usize

Slot which is missing a static string.

MissingStaticObjectKeys

Indicates that a static object keys is missing for the given slot.

Fields of MissingStaticObjectKeys

slot: usize

Slot which is missing a static object keys.

BadArgumentCount

Wrong number of arguments provided in call.

Fields of BadArgumentCount

actual: usize

The actual number of arguments.

expected: usize

The expected number of arguments.

BadArgumentType

Failure to convert from one type to another.

Fields of BadArgumentType

arg: usize

The argument location that was converted.

expected: ValueTypeInfo

The argument type we expected.

actual: ValueTypeInfo

The argument type we got.

BadArgument

Failure to convert from one type to another.

Fields of BadArgument

error: VmError

The underlying stack error.

arg: usize

The argument location that was converted.

to: &'static str

The native type we attempt to convert to.

BadReturn

Failure to convert return value.

Fields of BadReturn

error: VmError

Error describing the failed conversion.

ret: &'static str

Type of the return value we attempted to convert.

UnsupportedIndexSet

An index set operation that is not supported.

Fields of UnsupportedIndexSet

target: ValueTypeInfo

The target type to set.

index: ValueTypeInfo

The index to set.

value: ValueTypeInfo

The value to set.

UnsupportedIndexGet

An index get operation that is not supported.

Fields of UnsupportedIndexGet

target: ValueTypeInfo

The target type to get.

index: ValueTypeInfo

The index to get.

UnsupportedTupleIndexGet

An tuple index get operation that is not supported.

Fields of UnsupportedTupleIndexGet

target: ValueTypeInfo

The target type we tried to perform the tuple indexing on.

UnsupportedTupleIndexSet

An tuple index set operation that is not supported.

Fields of UnsupportedTupleIndexSet

target: ValueTypeInfo

The target type we tried to perform the tuple indexing on.

UnsupportedObjectSlotIndexGet

An object slot index get operation that is not supported.

Fields of UnsupportedObjectSlotIndexGet

target: ValueTypeInfo

The target type we tried to perform the object indexing on.

UnsupportedIs

An is operation is not supported.

Fields of UnsupportedIs

value: ValueTypeInfo

The argument that is not supported.

test_type: ValueTypeInfo

The type that is not supported.

UnsupportedCallFn

Encountered a value that could not be called as a function

Fields of UnsupportedCallFn

actual_type: ValueTypeInfo

The type that could not be called.

ObjectIndexMissing

Tried to fetch an index in an object that doesn't exist.

Fields of ObjectIndexMissing

slot: usize

The static string slot corresponding to the index that is missing.

MissingIndex

Tried to access an index that was missing on a type.

Fields of MissingIndex

target: ValueTypeInfo

Type where field did not exist.

index: Integer

Index that we tried to access.

MissingField

Missing a struct field.

Fields of MissingField

target: ValueTypeInfo

Type where field did not exist.

field: String

Field that was missing.

UnsupportedUnwrap

Error raised when we try to unwrap something that is not an option or result.

Fields of UnsupportedUnwrap

actual: ValueTypeInfo

The actual operand.

UnsupportedUnwrapNone

Error raised when we try to unwrap an Option that is not Some.

UnsupportedUnwrapErr

Error raised when we try to unwrap a Result that is not Ok.

Fields of UnsupportedUnwrapErr

err: ValueTypeInfo

The error variant.

UnsupportedIsValueOperand

Value is not supported for is-value test.

Fields of UnsupportedIsValueOperand

actual: ValueTypeInfo

The actual operand.

GeneratorComplete

Trying to resume a generator that has completed.

AccessError

Trying to access an inaccessible reference.

Fields of AccessError

error: AccessError

Source error.

Expected

Error raised when we expected one type, but got another.

Fields of Expected

expected: ValueTypeInfo

The expected value type info.

actual: ValueTypeInfo

The actual type found.

ExpectedAny

Error raised when we expected a value.

Fields of ExpectedAny

actual: ValueTypeInfo

The actual type observed instead.

ValueToIntegerCoercionError

Failure to convert a number into an integer.

Fields of ValueToIntegerCoercionError

from: Integer

Number we tried to convert from.

to: &'static str

Number type we tried to convert to.

IntegerToValueCoercionError

Failure to convert an integer into a value.

Fields of IntegerToValueCoercionError

from: Integer

Number we tried to convert from.

to: &'static str

Number type we tried to convert to.

ExpectedTupleLength

Error raised when we expected an tuple of the given length.

Fields of ExpectedTupleLength

actual: usize

The actual length observed.

expected: usize

The expected tuple length.

IterationError

Internal error that happens when we run out of items in a list.

Implementations

impl VmErrorKind[src]

pub fn into_unwound_ref(&self) -> (&Self, Option<(Arc<Unit>, usize)>)[src]

Unpack an unwound error, if it is present.

Trait Implementations

impl Debug for VmErrorKind[src]

impl Display for VmErrorKind[src]

impl Error for VmErrorKind[src]

impl From<AccessError> for VmErrorKind[src]

impl From<StackError> for VmErrorKind[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.

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