[][src]Enum wasmer_vm::Trap

pub enum Trap {
    User(Box<dyn Error + Send + Sync>),
    Wasm {
        pc: usize,
        backtrace: Backtrace,
        signal_trap: Option<TrapCode>,
    },
    Runtime {
        trap_code: TrapCode,
        backtrace: Backtrace,
    },
}

Stores trace message with backtrace.

Variants

User(Box<dyn Error + Send + Sync>)

A user-raised trap through raise_user_trap.

Wasm

A trap raised from machine code generated from Wasm

Fields of Wasm

pc: usize

The program counter in generated code where this trap happened.

backtrace: Backtrace

Native stack backtrace at the time the trap occurred

signal_trap: Option<TrapCode>

Optional trapcode associated to the signal that caused the trap

Runtime

A trap raised manually from the Wasmer VM

Fields of Runtime

trap_code: TrapCode

Code of the trap.

backtrace: Backtrace

Native stack backtrace at the time the trap occurred

Implementations

impl Trap[src]

pub fn new_from_wasm(
    pc: usize,
    backtrace: Backtrace,
    signal_trap: Option<TrapCode>
) -> Self
[src]

Construct a new VM Trap with the given the program counter, backtrace and an optional trap code associated with the signal received from the kernel. Wasm traps are Traps that are triggered by the chip when running generated code for a Wasm function.

pub fn new_from_runtime(trap_code: TrapCode) -> Self[src]

Construct a new runtime Trap with the given trap code. Runtime traps are Traps that are triggered manually from the VM.

Internally saves a backtrace when constructed.

pub fn new_from_user(error: Box<dyn Error + Send + Sync>) -> Self[src]

Construct a new Out of Memory (OOM) Trap.

Internally saves a backtrace when constructed.

Trait Implementations

impl Debug for Trap[src]

Auto Trait Implementations

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