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

Function wasmtime_func_call_async

crates/c-api/src/async.rs:249–276  ·  view source on GitHub ↗
(
    mut store: WasmtimeStoreContextMut<'a>,
    func: &'a Func,
    args: *const wasmtime_val_t,
    nargs: usize,
    results: *mut MaybeUninit<wasmtime_val_t>,
    nresults: usize,
    trap_ret: &

Source from the content-addressed store, hash-verified

247
248#[unsafe(no_mangle)]
249pub unsafe extern "C" fn wasmtime_func_call_async<'a>(
250 mut store: WasmtimeStoreContextMut<'a>,
251 func: &'a Func,
252 args: *const wasmtime_val_t,
253 nargs: usize,
254 results: *mut MaybeUninit<wasmtime_val_t>,
255 nresults: usize,
256 trap_ret: &'a mut *mut wasm_trap_t,
257 err_ret: &'a mut *mut wasmtime_error_t,
258) -> Box<wasmtime_call_future_t<'a>> {
259 let _ = &mut store;
260 #[cfg(feature = "gc")]
261 let mut store = wasmtime::RootScope::new(store);
262 let args = crate::slice_from_raw_parts(args, nargs)
263 .iter()
264 .map(|i| i.to_val(&mut store))
265 .collect::<Vec<_>>();
266 let results = crate::slice_from_raw_parts_mut(results, nresults);
267 let fut = Box::pin(do_func_call_async(
268 store,
269 func,
270 args.into_iter(),
271 results,
272 trap_ret,
273 err_ret,
274 ));
275 Box::new(wasmtime_call_future_t::new(fut))
276}
277
278#[unsafe(no_mangle)]
279pub unsafe extern "C" fn wasmtime_linker_define_async_func(

Callers 2

mainFunction · 0.85
TESTFunction · 0.85

Calls 8

slice_from_raw_partsFunction · 0.85
slice_from_raw_parts_mutFunction · 0.85
do_func_call_asyncFunction · 0.85
to_valMethod · 0.80
newFunction · 0.50
mapMethod · 0.45
iterMethod · 0.45
into_iterMethod · 0.45

Tested by 1

TESTFunction · 0.68