pub(crate) fn invoke_wasm_and_catch_traps<T>(
    store: &mut StoreContextMut<'_, T>,
    closure: impl FnMut(*mut VMContext),
) -> Result<(), Trap> {
    unsafe {
        let exit = if store
            .0
            .externref_activations_table()
            .stack_canary()
            .is_some()
        {
            false
        } else {
            enter_wasm(store)?;
            true
        };

        if let Err(trap) = store.0.exiting_native_hook() {
            if exit {
                exit_wasm(store);
            }
            return Err(trap);
        }
        let result = wasmtime_runtime::catch_traps(
            store.0.vminterrupts(),
            store.0.signal_handler(),
            store.0.default_callee(),
            closure,
        );
        if exit {
            exit_wasm(store);
        }
        store.0.entering_native_hook()?;
        result.map_err(Trap::from_runtime)
    }
}
/// Prepares for entrance into WebAssembly.
///
/// This function will set up context such that `closure` is allowed to call a
/// raw trampoline or a raw WebAssembly function. This *must* be called to do
/// things like catch traps and set up GC properly.
///
/// The `closure` provided receives a default "callee" `VMContext` parameter it
/// can pass to the called wasm function, if desired.
Prepares for entrance into WebAssembly.
This function will set up context such that `closure` is allowed to call a
raw trampoline or a raw WebAssembly function. This *must* be called to do
things like catch traps and set up GC properly.

The `closure` provided receives a default "callee" `VMContext` parameter it
can pass to the called wasm function, if desired.
Prepares for entrance into WebAssembly . This function will set up context such that ` closure ` is allowed to call a raw trampoline or a raw WebAssembly function . This * must * be called to do things like catch traps and set up GC properly . The ` closure ` provided receives a default " callee " ` VMContext ` parameter it can pass to the called wasm function if desired .
pub(crate) fn invoke_wasm_and_catch_traps<T>(
    store: &mut StoreContextMut<'_, T>,
    closure: impl FnMut(*mut VMContext),
) -> Result<(), Trap> {
    unsafe {
        let exit = if store
            .0
            .externref_activations_table()
            .stack_canary()
            .is_some()
        {
            false
        } else {
            enter_wasm(store)?;
            true
        };
        if let Err(trap) = store.0.exiting_native_hook() {
            if exit {
                exit_wasm(store);
            }
            return Err(trap);
        }
        let result = wasmtime_runtime::catch_traps(
            store.0.vminterrupts(),
            store.0.signal_handler(),
            store.0.default_callee(),
            closure,
        );
        if exit {
            exit_wasm(store);
        }
        store.0.entering_native_hook()?;
        result.map_err(Trap::from_runtime)
    }
}
pub ( crate ) fn invoke_wasm_and_catch_traps < T > ( store : & mut StoreContextMut < ' _ , T > , closure : impl FnMut ( * mut VMContext ) , ) -> Result < ( ) , Trap > { unsafe { let exit = if store . 0 . externref_activations_table ( ) . stack_canary ( ) . is_some ( ) { false } else { enter_wasm ( store ) ? ; true } ; if let Err ( trap ) = store . 0 . exiting_native_hook ( ) { if exit { exit_wasm ( store ) ; } return Err ( trap ) ; } let result = wasmtime_runtime :: catch_traps ( store . 0 . vminterrupts ( ) , store . 0 . signal_handler ( ) , store . 0 . default_callee ( ) , closure , ) ; if exit { exit_wasm ( store ) ; } store . 0 . entering_native_hook ( ) ? ; result . map_err ( Trap :: from_runtime ) } }
Prepares for entrance into WebAssembly.
Prepares for entrance into WebAssembly .
store
&mut StoreContextMut<'_, T>
closure
impl FnMut(*mut VMContext)
store
&mut StoreContextMut<'_, T>
closure
impl FnMut(*mut VMContext)