[][src]Enum runestick::VmErrorKind

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

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.

AccessError

Fields of AccessError

error: AccessError
Panic

Fields of Panic

reason: Panic
NoRunningVm
Halted

Fields of Halted

halt: VmHaltInfo
FormatError
StackError

Fields of StackError

error: StackError
Overflow
Underflow
DivideByZero
MissingConst

Fields of MissingConst

hash: Hash
MissingEntry

Fields of MissingEntry

item: Itemhash: Hash
MissingFunction

Fields of MissingFunction

hash: Hash
MissingInstanceFunction

Fields of MissingInstanceFunction

hash: Hashinstance: TypeInfo
IpOutOfBounds
UnsupportedAwait

Fields of UnsupportedAwait

actual: TypeInfo
UnsupportedBinaryOperation

Fields of UnsupportedBinaryOperation

op: &'static strlhs: TypeInforhs: TypeInfo
UnsupportedUnaryOperation

Fields of UnsupportedUnaryOperation

op: &'static stroperand: TypeInfo
MissingProtocol

Fields of MissingProtocol

protocol: Protocolactual: TypeInfo
MissingStaticString

Fields of MissingStaticString

slot: usize
MissingStaticObjectKeys

Fields of MissingStaticObjectKeys

slot: usize
MissingVariantRtti

Fields of MissingVariantRtti

hash: Hash
MissingRtti

Fields of MissingRtti

hash: Hash
BadArgumentCount

Fields of BadArgumentCount

actual: usizeexpected: usize
BadArgumentType

Fields of BadArgumentType

arg: usizeexpected: TypeInfoactual: TypeInfo
BadArgument

Fields of BadArgument

error: VmErrorarg: usize
BadReturn

Fields of BadReturn

error: VmError
UnsupportedIndexSet

Fields of UnsupportedIndexSet

target: TypeInfoindex: TypeInfovalue: TypeInfo
UnsupportedIndexGet

Fields of UnsupportedIndexGet

target: TypeInfoindex: TypeInfo
UnsupportedTupleIndexGet

Fields of UnsupportedTupleIndexGet

target: TypeInfo
UnsupportedTupleIndexSet

Fields of UnsupportedTupleIndexSet

target: TypeInfo
UnsupportedObjectSlotIndexGet

Fields of UnsupportedObjectSlotIndexGet

target: TypeInfo
UnsupportedIs

Fields of UnsupportedIs

value: TypeInfotest_type: TypeInfo
UnsupportedCallFn

Fields of UnsupportedCallFn

actual_type: TypeInfo
ObjectIndexMissing

Fields of ObjectIndexMissing

slot: usize
MissingIndex

Fields of MissingIndex

target: TypeInfoindex: VmIntegerRepr
MissingField

Fields of MissingField

target: TypeInfofield: String
MissingStructField

Fields of MissingStructField

target: &'static strname: &'static str
MissingTupleIndex

Fields of MissingTupleIndex

target: &'static strindex: usize
UnsupportedUnwrap

Fields of UnsupportedUnwrap

actual: TypeInfo
UnsupportedUnwrapNone
UnsupportedUnwrapErr

Fields of UnsupportedUnwrapErr

err: TypeInfo
UnsupportedIsValueOperand

Fields of UnsupportedIsValueOperand

actual: TypeInfo
GeneratorComplete

Trying to resume a generator that has completed.

Expected

Fields of Expected

expected: TypeInfoactual: TypeInfo
ExpectedAny

Fields of ExpectedAny

actual: TypeInfo
ValueToIntegerCoercionError

Fields of ValueToIntegerCoercionError

from: VmIntegerReprto: &'static str
IntegerToValueCoercionError

Fields of IntegerToValueCoercionError

from: VmIntegerReprto: &'static str
ExpectedTupleLength

Fields of ExpectedTupleLength

actual: usizeexpected: usize
IterationError
MissingVariantName
MissingVariant

Fields of MissingVariant

name: Box<str>
ExpectedVariant

Fields of ExpectedVariant

actual: TypeInfo
ConstNotSupported

Fields of ConstNotSupported

actual: TypeInfo
MissingInterfaceEnvironment

Implementations

impl VmErrorKind[src]

pub fn as_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.