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

Method call_component_func

src/commands/run.rs:837–854  ·  view source on GitHub ↗
(
        &self,
        store: &mut Store<Host>,
        params: &[wasmtime::component::Val],
        func: wasmtime::component::Func,
        results: &mut Vec<wasmtime::component::Val>,
    )

Source from the content-addressed store, hash-verified

835
836 #[cfg(feature = "component-model")]
837 async fn call_component_func(
838 &self,
839 store: &mut Store<Host>,
840 params: &[wasmtime::component::Val],
841 func: wasmtime::component::Func,
842 results: &mut Vec<wasmtime::component::Val>,
843 ) -> Result<(), Error> {
844 #[cfg(feature = "component-model-async")]
845 if self.run.common.wasm.concurrency_support.unwrap_or(true) {
846 store
847 .run_concurrent(async |store| func.call_concurrent(store, params, results).await)
848 .await??;
849 return Ok(());
850 }
851
852 func.call_async(&mut *store, &params, results).await?;
853 Ok(())
854 }
855
856 /// Execute the default behavior for components on the CLI, looking for
857 /// `wasi:cli`-based commands and running their exported `run` function.

Callers 1

invoke_componentMethod · 0.80

Calls 4

OkFunction · 0.85
run_concurrentMethod · 0.80
call_concurrentMethod · 0.80
call_asyncMethod · 0.45

Tested by

no test coverage detected