[][src]Function wasmer_vm::catch_traps_with_result

pub unsafe fn catch_traps_with_result<F, R>(
    vmctx: VMFunctionEnvironment,
    mut closure: F
) -> Result<R, Trap> where
    F: FnMut() -> R, 

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

The main difference from this method and catch_traps, is that is able to return the results from the closure.

Safety

Check catch_traps.