Function catch_traps_with_result

Source
pub unsafe fn catch_traps_with_result<F, R>(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.