pub enum InstructionErrorKind {
Show 20 variants InvocationInputIsMissing { index: u32, }, ToNative(WasmValueNativeCastError), LoweringLifting { from: IType, to: IType, }, InvalidValueOnTheStack { expected_type: IType, received_value: IValue, }, StackIsTooSmall { needed: usize, }, LocalOrImportIsMissing { function_index: u32, }, LocalOrImportSignatureMismatch { function_index: u32, expected: (Vec<IType>, Vec<IType>), received: (Vec<IType>, Vec<IType>), }, LocalOrImportCall { function_name: String, reason: Error, }, MemoryIsMissing { memory_index: usize, }, MemoryOutOfBoundsAccess { index: u32, length: u32, }, String(FromUtf8Error), NegativeValue { subject: &'static str, }, TypeIsMissing { type_index: u32, }, RecordTypeByNameIsMissing { record_type_id: u64, }, CorruptedArray(String), CorruptedRecord(String), InvalidTypeKind { expected_kind: TypeKind, received_kind: TypeKind, }, SerdeError(String), LiError(LiError), LoError(LoError),
}
Expand description

The kind of instruction errors.

Variants§

§

InvocationInputIsMissing

Fields

§index: u32

The invocation input index.

The instruction needs to read an invocation input at index index, but it’s missing.

§

ToNative(WasmValueNativeCastError)

Failed to cast from a WIT value to a native value.

§

LoweringLifting

Fields

§from: IType

The initial type.

§to: IType

The targeted type.

Failed to cast from from to to.

§

InvalidValueOnTheStack

Fields

§expected_type: IType

The expected type.

§received_value: IValue

The received type.

Read a value from the stack, but it doesn’t have the expected type.

§

StackIsTooSmall

Fields

§needed: usize

The number of values that were needed.

Need to read some values from the stack, but it doesn’t contain enough data.

§

LocalOrImportIsMissing

Fields

§function_index: u32

The local or import function index.

The local or import function doesn’t exist.

§

LocalOrImportSignatureMismatch

Fields

§function_index: u32

The local or import function index.

§expected: (Vec<IType>, Vec<IType>)

The expected signature.

§received: (Vec<IType>, Vec<IType>)

The received signature.

Values given to a local or import function doesn’t match the function signature.

§

LocalOrImportCall

Fields

§function_name: String

The local or import function name that has been called.

§reason: Error

Error returned by the local or import call

Failed to call a local or import function.

§

MemoryIsMissing

Fields

§memory_index: usize

The memory index.

The memory doesn’t exist.

§

MemoryOutOfBoundsAccess

Fields

§index: u32

The access index.

§length: u32

The memory length.

Tried to read out of bounds of the memory.

§

String(FromUtf8Error)

The string contains invalid UTF-8 encoding.

§

NegativeValue

Fields

§subject: &'static str

The variable name that triggered the error.

Out of range integral type conversion attempted.

§

TypeIsMissing

Fields

§type_index: u32

The type index.

The type doesn’t exist.

§

RecordTypeByNameIsMissing

Fields

§record_type_id: u64

The record type name.

The searched by id type doesn’t exist.

§

CorruptedArray(String)

Corrupted array’s been popped from the stack.

§

CorruptedRecord(String)

Corrupted record’s been popped from the stack.

§

InvalidTypeKind

Fields

§expected_kind: TypeKind

The expected kind.

§received_kind: TypeKind

The received kind.

Read a type that has an unexpected type.

§

SerdeError(String)

Errors related to Serialization/deserialization of record.

§

LiError(LiError)

Errors related to lifting/lowering records.

§

LoError(LoError)

Errors related to incorrect writing to memory.

Trait Implementations§

source§

impl Debug for InstructionErrorKind

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for InstructionErrorKind

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for InstructionErrorKind

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<(TryFromIntError, &'static str)> for InstructionErrorKind

source§

fn from((_, subject): (TryFromIntError, &'static str)) -> Self

Converts to this type from the input type.
source§

impl From<LiError> for InstructionErrorKind

source§

fn from(source: LiError) -> Self

Converts to this type from the input type.
source§

impl From<LoError> for InstructionErrorKind

source§

fn from(source: LoError) -> Self

Converts to this type from the input type.
source§

impl From<WasmValueNativeCastError> for InstructionErrorKind

source§

fn from(source: WasmValueNativeCastError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.