Enum wasmer_vm::TrapCode[][src]

#[repr(u32)]
pub enum TrapCode {
Show 13 variants StackOverflow, HeapAccessOutOfBounds, HeapMisaligned, TableAccessOutOfBounds, OutOfBounds, IndirectCallToNull, BadSignature, IntegerOverflow, IntegerDivisionByZero, BadConversionToInteger, UnreachableCodeReached, UnalignedAtomic, GasExceeded,
}
Expand description

A trap code describing the reason for a trap.

All trap instructions have an explicit trap code.

Variants

StackOverflow

The current stack space was exhausted.

On some platforms, a stack overflow may also be indicated by a segmentation fault from the stack guard page.

HeapAccessOutOfBounds

A heap_addr instruction detected an out-of-bounds error.

Note that not all out-of-bounds heap accesses are reported this way; some are detected by a segmentation fault on the heap unmapped or offset-guard pages.

HeapMisaligned

A heap_addr instruction was misaligned.

TableAccessOutOfBounds

A table_addr instruction detected an out-of-bounds error.

OutOfBounds

Other bounds checking error.

IndirectCallToNull

Indirect call to a null table entry.

BadSignature

Signature mismatch on indirect call.

IntegerOverflow

An integer arithmetic operation caused an overflow.

IntegerDivisionByZero

An integer division by zero.

BadConversionToInteger

Failed float-to-int conversion.

UnreachableCodeReached

Code that was supposed to have been unreachable was reached.

UnalignedAtomic

An atomic memory access was attempted with an unaligned pointer.

GasExceeded

Hit the gas limit.

Implementations

Gets the message for this trap code

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

Formats the value using the given formatter. Read more

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

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

Returns the size of the referenced value in bytes. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. 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.