MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / func_wrap_async

Method func_wrap_async

crates/wasmtime/src/runtime/linker.rs:574–588  ·  view source on GitHub ↗
(
        &mut self,
        module: &str,
        name: &str,
        func: F,
    )

Source from the content-addressed store, hash-verified

572 /// Asynchronous analog of [`Linker::func_wrap`].
573 #[cfg(feature = "async")]
574 pub fn func_wrap_async<F, Params: crate::WasmTyList, Args: crate::WasmRet>(
575 &mut self,
576 module: &str,
577 name: &str,
578 func: F,
579 ) -> Result<&mut Self>
580 where
581 F: for<'a> Fn(Caller<'a, T>, Params) -> Box<dyn Future<Output = Args> + Send + 'a>
582 + Send
583 + Sync
584 + 'static,
585 T: Send + 'static,
586 {
587 self.func_insert(module, name, HostFunc::wrap_async(&self.engine, func)?)
588 }
589
590 /// Convenience wrapper to define an entire [`Instance`] in this linker.
591 ///

Calls 1

func_insertMethod · 0.80

Tested by 15

add_to_linker_instanceFunction · 0.36
add_to_linker_importsMethod · 0.36
add_to_linker_instanceFunction · 0.36
add_to_linker_instanceFunction · 0.36
add_to_linker_instanceFunction · 0.36
add_to_linker_instanceFunction · 0.36
add_to_linker_instanceFunction · 0.36
add_to_linker_instanceFunction · 0.36
add_to_linker_instanceFunction · 0.36
add_to_linker_importsMethod · 0.36
add_to_linker_instanceFunction · 0.36
add_to_linker_instanceFunction · 0.36