pub enum TrapCode {
Show 14 variants
StackOverflow,
HeapOutOfBounds,
HeapMisaligned,
TableOutOfBounds,
IndirectCallToNull,
BadSignature,
IntegerOverflow,
IntegerDivisionByZero,
BadConversionToInteger,
UnreachableCodeReached,
Interrupt,
User(u16),
NullReference,
NullI31Ref,
}
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.
HeapOutOfBounds
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 wasm atomic operation was presented with a not-naturally-aligned linear-memory address.
TableOutOfBounds
A table_addr
instruction detected an out-of-bounds 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.
Interrupt
Execution has potentially run too long and may be interrupted.
User(u16)
A user-defined trap code.
NullReference
A null reference was encountered which was required to be non-null.
NullI31Ref
A null i31ref
was encountered which was required to be non-null.
Implementations§
Trait Implementations§
impl Copy for TrapCode
impl Eq for TrapCode
impl StructuralPartialEq for TrapCode
Auto Trait Implementations§
impl Freeze for TrapCode
impl RefUnwindSafe for TrapCode
impl Send for TrapCode
impl Sync for TrapCode
impl Unpin for TrapCode
impl UnwindSafe for TrapCode
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.