Struct wasmtime::Trap [−][src]
pub struct Trap { /* fields omitted */ }A struct representing an aborted instruction execution, with a message indicating the cause.
Implementations
impl Trap[src]
impl Trap[src]pub fn new<I: Into<String>>(message: I) -> Self[src]
Creates a new Trap with message.
Example
let trap = wasmtime::Trap::new("unexpected error"); assert!(trap.to_string().contains("unexpected error"));
pub fn i32_exit(status: i32) -> Self[src]
Creates a new Trap representing an explicit program exit with a classic i32
exit status value.
pub fn i32_exit_status(&self) -> Option<i32>[src]
If the trap was the result of an explicit program exit with a classic
i32 exit status value, return the value, otherwise return None.
pub fn trace(&self) -> &[FrameInfo][src]
Returns a list of function frames in WebAssembly code that led to this trap happening.
pub fn trap_code(&self) -> Option<TrapCode>[src]
Code of a trap that happened while executing a WASM instruction.
If the trap was triggered by a host export this will be None.