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

Method func_new_async

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

Source from the content-addressed store, hash-verified

717 /// For documentation on blocking behavior see [`Self::func_wrap_async`].
718 #[cfg(feature = "async")]
719 pub fn func_new_async<F>(&mut self, name: &str, func: F) -> Result<()>
720 where
721 F: for<'a> Fn(
722 StoreContextMut<'a, T>,
723 types::ComponentFunc,
724 &'a [Val],
725 &'a mut [Val],
726 ) -> Box<dyn Future<Output = Result<()>> + Send + 'a>
727 + Send
728 + Sync
729 + 'static,
730 {
731 self.insert(name, Definition::Func(HostFunc::func_new_async(func)?))?;
732 Ok(())
733 }
734
735 /// Define a new host-provided async function using dynamic types.
736 ///

Callers

nothing calls this directly

Calls 3

OkFunction · 0.85
FuncClass · 0.70
insertMethod · 0.45

Tested by

no test coverage detected