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

Function wasmtime_linker_define_async_func

crates/c-api/src/async.rs:279–299  ·  view source on GitHub ↗
(
    linker: &mut wasmtime_linker_t,
    module: *const u8,
    module_len: usize,
    name: *const u8,
    name_len: usize,
    ty: &wasm_functype_t,
    callback: crate::wasmtime_func_async_callbac

Source from the content-addressed store, hash-verified

277
278#[unsafe(no_mangle)]
279pub unsafe extern "C" fn wasmtime_linker_define_async_func(
280 linker: &mut wasmtime_linker_t,
281 module: *const u8,
282 module_len: usize,
283 name: *const u8,
284 name_len: usize,
285 ty: &wasm_functype_t,
286 callback: crate::wasmtime_func_async_callback_t,
287 data: *mut c_void,
288 finalizer: Option<extern "C" fn(*mut std::ffi::c_void)>,
289) -> Option<Box<wasmtime_error_t>> {
290 let ty = ty.ty().ty(linker.linker.engine());
291 let module = to_str!(module, module_len);
292 let name = to_str!(name, name_len);
293 let cb = c_async_callback_to_rust_fn(callback, data, finalizer);
294
295 handle_result(
296 linker.linker.func_new_async(module, name, ty, cb),
297 |_linker| (),
298 )
299}
300
301async fn do_linker_instantiate_async(
302 linker: &wasmtime_linker_t,

Callers 1

mainFunction · 0.85

Calls 5

handle_resultFunction · 0.85
tyMethod · 0.45
engineMethod · 0.45
func_new_asyncMethod · 0.45

Tested by

no test coverage detected