[][src]Enum runestick::VmErrorKind

pub enum VmErrorKind {
    Panic {
        reason: Panic,
    },
    Stopped {
        reason: StopReason,
    },
    UnwindedVmError {
        kind: Box<VmErrorKind>,
        ip: usize,
    },
    FormatError,
    StackError {
        error: StackError,
    },
    AccessError {
        error: AccessError,
    },
    ValueError {
        error: ValueError,
    },
    Overflow,
    Underflow,
    DivideByZero,
    MissingFunction {
        hash: Hash,
    },
    MissingInstanceFunction {
        instance: ValueTypeInfo,
        hash: Hash,
    },
    IpOutOfBounds,
    UnsupportedAwait,
    BadArgument {
        argument: 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,
    },
    StackConversionError {
        error: ValueError,
        to: &'static str,
    },
    ArgumentConversionError {
        error: ValueError,
        arg: usize,
        to: &'static str,
    },
    ArgumentCountMismatch {
        actual: usize,
        expected: usize,
    },
    ReturnConversionError {
        error: ValueError,
        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,
}

The kind of error encountered.

Variants

Panic

The virtual machine panicked for a specific reason.

Fields of Panic

reason: Panic

The reason for the panic.

Stopped

The virtual machine stopped for an unexpected reason.

Fields of Stopped

reason: StopReason

The reason why the virtual machine stopped.

UnwindedVmError

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 UnwindedVmError

kind: Box<VmErrorKind>

The actual error.

ip: usize

The instruction pointer of where the original error happened.

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.

AccessError

Trying to access an inaccessible reference.

Fields of AccessError

error: AccessError

Source error.

ValueError

Error raised when trying to access a value.

Fields of ValueError

error: ValueError

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

instance: ValueTypeInfo

The instance type we tried to look up function on.

hash: Hash

Hash of function to look up.

IpOutOfBounds

Instruction pointer went out-of-bounds.

UnsupportedAwait

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

BadArgument

A bad argument that was received to a function.

Fields of BadArgument

argument: ValueTypeInfo

The argument type.

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.

StackConversionError

Indicates a failure to convert from one type to another.

Fields of StackConversionError

error: ValueError

The source of the error.

to: &'static str

The expected type to convert towards.

ArgumentConversionError

Failure to convert from one type to another.

Fields of ArgumentConversionError

error: ValueError

The underlying stack error.

arg: usize

The argument location that was converted.

to: &'static str

The native type we attempt to convert to.

ArgumentCountMismatch

Wrong number of arguments provided in call.

Fields of ArgumentCountMismatch

actual: usize

The actual number of arguments.

expected: usize

The expected number of arguments.

ReturnConversionError

Failure to convert return value.

Fields of ReturnConversionError

error: ValueError

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.

Implementations

impl VmErrorKind[src]

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

Unpack an unwinded 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>,