pub enum WasmErrorInner {
    PointerMap,
    Deserialize(Vec<u8, Global>),
    Serialize(SerializedBytesError),
    ErrorWhileError,
    Memory,
    Guest(String),
    Host(String),
    HostShortCircuit(Vec<u8, Global>),
    Compile(String),
    CallError(String),
    UninitializedSerializedModuleCache,
}
Expand description

Enum of all possible ERROR states that wasm can encounter.

Used in [wasm_error!] for specifying the error type and message.

Variants§

§

PointerMap

While moving pointers and lengths across the host/guest, we hit an unsafe conversion such as a negative pointer or out of bounds value.

§

Deserialize(Vec<u8, Global>)

These bytes failed to deserialize. The host should provide nice debug info and context that the wasm guest won’t have.

§

Serialize(SerializedBytesError)

Something failed to serialize. This should be rare or impossible for almost everything that implements Serialize.

§

ErrorWhileError

Somehow we errored while erroring. For example, maybe we failed to serialize an error while attempting to serialize an error.

§

Memory

Something went wrong while writing or reading bytes to/from wasm memory. Whatever this is, it is very bad and probably not recoverable.

§

Guest(String)

Error with guest logic that the host doesn’t know about.

§

Host(String)

Error with host logic that the guest doesn’t know about.

§

HostShortCircuit(Vec<u8, Global>)

Something to do with host logic that the guest doesn’t know about AND wasm execution MUST immediately halt. The Vec<u8> holds the encoded data as though the guest had returned.

§

Compile(String)

Wasmer failed to compile machine code from wasm byte code.

§

CallError(String)

The host failed to call a function in the guest.

§

UninitializedSerializedModuleCache

Host attempted to interact with the module cache before it was initialized.

Implementations§

Some errors indicate the wasm guest is potentially corrupt and so the host MUST NOT reuse it (e.g. in a cache of wasm instances). Other errors MAY NOT invalidate an instance cache on the host.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method returns an Ordering between self and other. Read more
Compares and returns the maximum of two values. Read more
Compares and returns the minimum of two values. Read more
Restrict a value to a certain interval. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
This method returns an ordering between self and other values if one exists. Read more
This method tests less than (for self and other) and is used by the < operator. Read more
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
This method tests greater than (for self and other) and is used by the > operator. Read more
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
The archived version of the pointer metadata for this type.
Converts some archived metadata to the pointer metadata for itself.
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Deserializes using the given deserializer
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type for metadata in pointers and references to Self.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
upcast ref
upcast mut ref
upcast boxed dyn
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more