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

Method call_async

crates/wasmtime/src/runtime/component/func.rs:257–278  ·  view source on GitHub ↗
(
        &self,
        mut store: impl AsContextMut<Data: Send>,
        params: &[Val],
        results: &mut [Val],
    )

Source from the content-addressed store, hash-verified

255 /// Panics if `store` does not own this function.
256 #[cfg(feature = "async")]
257 pub async fn call_async(
258 &self,
259 mut store: impl AsContextMut<Data: Send>,
260 params: &[Val],
261 results: &mut [Val],
262 ) -> Result<()> {
263 let mut store = store.as_context_mut();
264
265 #[cfg(feature = "component-model-async")]
266 if store.0.concurrency_support() {
267 let call = self.start_call_concurrent(&mut store, params, results)?;
268 return store
269 .run_concurrent_trap_on_idle(async |store| {
270 self.finish_call_concurrent(store, call).await
271 })
272 .await?;
273 }
274
275 store
276 .on_fiber(|store| self.call_impl(store, params, results))
277 .await?
278 }
279
280 pub(crate) fn check_params_results<T>(
281 &self,

Callers

nothing calls this directly

Calls 7

start_call_concurrentMethod · 0.80
on_fiberMethod · 0.80
as_context_mutMethod · 0.45
concurrency_supportMethod · 0.45
call_implMethod · 0.45

Tested by

no test coverage detected