Function wasmer_vm::catch_traps_with_result
source · [−]pub unsafe fn catch_traps_with_result<F, R>(
trap_handler: &dyn TrapHandler,
closure: F
) -> Result<R, Trap> where
F: FnMut() -> R, Expand description
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.