Function catch_traps
pub unsafe fn catch_traps<F, R>(
trap_handler: Option<*const dyn Fn(i32, *const siginfo_t, *const c_void) -> bool + Sync + Send>,
config: &VMConfig,
closure: F,
) -> Result<R, Trap>where
R: 'static,
F: FnOnce() -> R + 'static,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.