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

Method func_wrap_async

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

Source from the content-addressed store, hash-verified

512 /// [`func_wrap_async`]: LinkerInstance::func_wrap_async
513 #[cfg(feature = "async")]
514 pub fn func_wrap_async<Params, Return, F>(&mut self, name: &str, f: F) -> Result<()>
515 where
516 F: Fn(
517 StoreContextMut<'_, T>,
518 Params,
519 ) -> Box<dyn Future<Output = Result<Return>> + Send + '_>
520 + Send
521 + Sync
522 + 'static,
523 Params: ComponentNamedList + Lift + 'static,
524 Return: ComponentNamedList + Lower + 'static,
525 {
526 self.insert(name, Definition::Func(HostFunc::func_wrap_async(f)?))?;
527 Ok(())
528 }
529
530 /// Defines a new host-provided async function into this [`LinkerInstance`].
531 ///

Callers

nothing calls this directly

Calls 3

OkFunction · 0.85
FuncClass · 0.70
insertMethod · 0.45

Tested by

no test coverage detected