Function wasmer_vm::catch_traps

source ·
pub unsafe fn catch_traps<F, R: 'static>(
    trap_handler: Option<*const TrapHandlerFn<'static>>,
    config: &VMConfig,
    closure: F,
) -> Result<R, Trap>
where F: FnOnce() -> R + 'static,
Expand description

Catches any wasm traps that happen within the execution of closure, returning them as a Result.

§Safety

Highly unsafe since closure won’t have any dtors run.