[][src]Enum stk::VmError

pub enum VmError {
    Panic {
        reason: Panic,
    },
    Overflow,
    Underflow,
    DivideByZero,
    UserError {
        error: Error,
    },
    StackError {
        error: StackError,
    },
    MissingFunction {
        hash: Hash,
    },
    MissingModule {
        module: Hash,
    },
    MissingModuleFunction {
        module: Hash,
        hash: Hash,
    },
    IpOutOfBounds,
    UnsupportedBinaryOperation {
        op: &'static str,
        lhs: ValueTypeInfo,
        rhs: ValueTypeInfo,
    },
    UnsupportedUnaryOperation {
        op: &'static str,
        operand: ValueTypeInfo,
    },
    UnsupportedObjectKey {
        actual: ValueTypeInfo,
    },
    StackOutOfBounds,
    MissingStaticString {
        slot: usize,
    },
    MissingStaticObjectKeys {
        slot: usize,
    },
    StackTopTypeError {
        expected: ValueTypeInfo,
        actual: ValueTypeInfo,
    },
    StackConversionError {
        error: StackError,
        from: ValueTypeInfo,
        to: &'static str,
    },
    ArgumentConversionError {
        error: StackError,
        arg: usize,
        from: ValueTypeInfo,
        to: &'static str,
    },
    ArgumentCountMismatch {
        actual: usize,
        expected: usize,
    },
    ReturnConversionError {
        error: StackError,
        ret: &'static str,
    },
    UnsupportedIndexSet {
        target_type: ValueTypeInfo,
        index_type: ValueTypeInfo,
        value_type: ValueTypeInfo,
    },
    UnsupportedIndexGet {
        target_type: ValueTypeInfo,
        index_type: ValueTypeInfo,
    },
    UnsupportedArrayIndexGet {
        target_type: ValueTypeInfo,
    },
    UnsupportedObjectSlotIndexGet {
        target_type: ValueTypeInfo,
    },
    UnsupportedIs {
        value_type: ValueTypeInfo,
        test_type: ValueTypeInfo,
    },
    UnsupportedReplaceDeref {
        target_type: ValueTypeInfo,
        value_type: ValueTypeInfo,
    },
    UnsupportedDeref {
        actual_type: ValueTypeInfo,
    },
    MissingType {
        hash: Hash,
    },
    IllegalPtrReplace {
        target_ptr: usize,
        value_ptr: usize,
    },
    UnsupportedCallFn {
        actual_type: ValueTypeInfo,
    },
    ArrayIndexMissing {
        index: usize,
    },
    ObjectIndexMissing {
        slot: usize,
    },
}

Errors raised by the execution of the virtual machine.

Variants

Panic

The virtual machine panicked for no specific reason.

Fields of Panic

reason: Panic

The reason for the panic.

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.

UserError

Error raised in a user-defined function.

Fields of UserError

error: Error

Source error.

StackError

Failure to interact with the stack.

Fields of StackError

error: StackError

Source error.

MissingFunction

Failure to lookup function.

Fields of MissingFunction

hash: Hash

Hash of function to look up.

MissingModule

Failure to lookup module.

Fields of MissingModule

module: Hash

Hash of module to look up.

MissingModuleFunction

Failure to lookup function in a module.

Fields of MissingModuleFunction

module: Hash

Module that was looked up.

hash: Hash

Function that could not be found.

IpOutOfBounds

Instruction pointer went out-of-bounds.

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.

UnsupportedObjectKey

Unsupported argument to object-exact-keys.

Fields of UnsupportedObjectKey

actual: ValueTypeInfo

The encountered argument.

StackOutOfBounds

Attempt to access out-of-bounds stack item.

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.

StackTopTypeError

Saw an unexpected stack value.

Fields of StackTopTypeError

expected: ValueTypeInfo

The type that was expected.

actual: ValueTypeInfo

The type observed.

StackConversionError

Indicates a failure to convert from one type to another.

Fields of StackConversionError

error: StackError

The source of the error.

from: ValueTypeInfo

The actual type to be converted.

to: &'static str

The expected type to convert towards.

ArgumentConversionError

Failure to convert from one type to another.

Fields of ArgumentConversionError

error: StackError

The underlying stack error.

arg: usize

The argument location that was converted.

from: ValueTypeInfo

The value type we attempted to convert from.

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: StackError

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_type: ValueTypeInfo

The target type to set.

index_type: ValueTypeInfo

The index to set.

value_type: ValueTypeInfo

The value to set.

UnsupportedIndexGet

An index get operation that is not supported.

Fields of UnsupportedIndexGet

target_type: ValueTypeInfo

The target type to get.

index_type: ValueTypeInfo

The index to get.

UnsupportedArrayIndexGet

An array index get operation that is not supported.

Fields of UnsupportedArrayIndexGet

target_type: ValueTypeInfo

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

UnsupportedObjectSlotIndexGet

An object slot index get operation that is not supported.

Fields of UnsupportedObjectSlotIndexGet

target_type: ValueTypeInfo

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

UnsupportedIs

An is operation is not supported.

Fields of UnsupportedIs

value_type: ValueTypeInfo

The argument that is not supported.

test_type: ValueTypeInfo

The type that is not supported.

UnsupportedReplaceDeref

Encountered a value that could not be dereferenced.

Fields of UnsupportedReplaceDeref

target_type: ValueTypeInfo

The type we try to assign to.

value_type: ValueTypeInfo

The type we try to assign.

UnsupportedDeref

Encountered a value that could not be dereferenced.

Fields of UnsupportedDeref

actual_type: ValueTypeInfo

The type that could not be de-referenced.

MissingType

Missing type.

Fields of MissingType

hash: Hash

Hash of the type missing.

IllegalPtrReplace

Attempting to assign an illegal pointer.

Fields of IllegalPtrReplace

target_ptr: usize

The target ptr being assigned to.

value_ptr: usize

The value ptr we are trying to assign.

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.

ArrayIndexMissing

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

Fields of ArrayIndexMissing

index: usize

The missing index.

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.

Trait Implementations

impl Debug for VmError[src]

impl Display for VmError[src]

impl Error for VmError[src]

impl Error for VmError[src]

impl From<Error> for VmError[src]

impl From<StackError> for VmError[src]

Auto Trait Implementations

impl RefUnwindSafe for VmError

impl Send for VmError

impl Sync for VmError

impl Unpin for VmError

impl UnwindSafe for VmError

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>,