pub unsafe fn catch_traps<F, R>(
    trap_handler: &(dyn TrapHandler + 'static),
    closure: F
) -> Result<R, Trap> where
    F: FnOnce() -> R, 
Expand description

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.