Function catch_traps

Source
pub unsafe fn catch_traps<F>(closure: F) -> Result<(), Trap>
where F: FnMut(),
Expand description

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

ยงSafety

Soundness must not depend on closure destructors being run.