wasmtime_linker_define_func function
- @Native<Pointer<
wasmtime_error_t> Function(Pointer<wasmtime_linker_t> , Pointer<wasm_byte_t> , Size, Pointer<wasm_byte_t> , Size, Pointer<wasm_functype_t> , wasmtime_func_callback_t, Pointer<Void> , Pointer<NativeFunction< )>(ffi.Pointer<wasmtime_linker_t>, ffi.Pointer<ffi.Char>, ffi.Size, ffi.Pointer<ffi.Char>, ffi.Size, ffi.Pointer<wasm_functype_t>, wasmtime_func_callback_t, ffi.Pointer<ffi.Void>, ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>)>()Void Function(Pointer< >Void> )>
- Pointer<
wasmtime_linker_t> linker, - Pointer<
wasm_byte_t> module, - int module_len,
- Pointer<
wasm_byte_t> name, - int name_len,
- Pointer<
wasm_functype_t> ty, - wasmtime_func_callback_t cb,
- Pointer<
Void> data, - Pointer<
NativeFunction< finalizer,Void Function(Pointer< >Void> )>
\brief Defines a new function in this linker.
\param linker the linker the name is being defined in.
\param module the module name the item is defined under.
\param module_len the byte length of module
\param name the field name the item is defined under
\param name_len the byte length of name
\param ty the type of the function that's being defined
\param cb the host callback to invoke when the function is called
\param data the host-provided data to provide as the first argument to the
callback
\param finalizer an optional finalizer for the data argument.
\return On success NULL is returned, otherwise an error is returned which
describes why the definition failed.
For more information about name resolution consult the Rust documentation.
Note that this function does not create a #wasmtime_func_t. This creates a store-independent function within the linker, allowing this function definition to be used with multiple stores.
For more information about host callbacks see #wasmtime_func_new.
Implementation
@ffi.Native<
ffi.Pointer<wasmtime_error_t> Function(
ffi.Pointer<wasmtime_linker_t>,
ffi.Pointer<ffi.Char>,
ffi.Size,
ffi.Pointer<ffi.Char>,
ffi.Size,
ffi.Pointer<wasm_functype_t>,
wasmtime_func_callback_t,
ffi.Pointer<ffi.Void>,
ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>,
)
>()
external ffi.Pointer<wasmtime_error_t> wasmtime_linker_define_func(
ffi.Pointer<wasmtime_linker_t> linker,
ffi.Pointer<ffi.Char> module,
int module_len,
ffi.Pointer<ffi.Char> name,
int name_len,
ffi.Pointer<wasm_functype_t> ty,
wasmtime_func_callback_t cb,
ffi.Pointer<ffi.Void> data,
ffi.Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>
finalizer,
);