wasmtime_func_callback_t typedef

\brief Callback signature for #wasmtime_func_new.

This is the function signature for host functions that can be made accessible to WebAssembly. The arguments to this function are:

\param env user-provided argument passed to #wasmtime_func_new \param caller a temporary object that can only be used during this function call. Used to acquire #wasmtime_context_t or caller's state \param args the arguments provided to this function invocation \param nargs how many arguments are provided \param results where to write the results of this function \param nresults how many results must be produced

Callbacks are guaranteed to get called with the right types of arguments, but they must produce the correct number and types of results. Failure to do so will cause traps to get raised on the wasm side.

This callback can optionally return a #wasm_trap_t indicating that a trap should be raised in WebAssembly. It's expected that in this case the caller relinquishes ownership of the trap and it is passed back to the engine.

Implementation

typedef wasmtime_func_callback_t =
    ffi.Pointer<ffi.NativeFunction<wasmtime_func_callback_tFunction>>;