Enum wasmtime_runtime::Trap
source · pub enum Trap {
User {
error: Error,
backtrace: Option<Backtrace>,
},
Jit {
pc: usize,
backtrace: Option<Backtrace>,
},
Wasm {
trap_code: TrapCode,
backtrace: Option<Backtrace>,
},
OOM {
backtrace: Option<Backtrace>,
},
}
Expand description
Stores trace message with backtrace.
Variants§
User
Fields
A user-raised trap through raise_user_trap
.
Jit
Fields
A trap raised from jit code
Wasm
Fields
A trap raised from a wasm libcall
OOM
A trap indicating that the runtime was unable to allocate sufficient memory.
Implementations§
source§impl Trap
impl Trap
sourcepub fn wasm(trap_code: TrapCode) -> Self
pub fn wasm(trap_code: TrapCode) -> Self
Construct a new Wasm trap with the given trap code.
Internally saves a backtrace when passed across a setjmp boundary, if the engine is configured to save backtraces.