[][src]Function wasmtime_runtime::catch_traps

pub unsafe fn catch_traps<F>(
    vmctx: *mut VMContext,
    max_wasm_stack: usize,
    is_wasm_code: impl Fn(usize) -> bool,
    signal_handler: Option<&SignalHandler>,
    closure: F
) -> Result<(), Trap> where
    F: FnMut(), 

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

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