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
error: ErrorThe user-provided error
A user-raised trap through raise_user_trap.
Jit
Fields
pc: usizeThe program counter in JIT code where this trap happened.
A trap raised from jit code
Wasm
Fields
trap_code: TrapCodeCode of the trap.
A trap raised from a wasm libcall
OOM
A trap indicating that the runtime was unable to allocate sufficient memory.
Implementations
sourceimpl 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.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Trap
impl Send for Trap
impl Sync for Trap
impl Unpin for Trap
impl !UnwindSafe for Trap
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more