pub unsafe fn catch_traps<F, R>(
    trap_handler: Option<*const TrapHandlerFn<'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.

Safety

Highly unsafe since closure won’t have any dtors run.