wasmtime_linker_instantiate function

  1. @Native<Pointer<wasmtime_error_t> Function(Pointer<wasmtime_linker_t> linker, Pointer<wasmtime_context_t> store, Pointer<wasmtime_module_t> module, Pointer<wasmtime_instance_t> instance, Pointer<Pointer<wasm_trap_t>> trap)>(ffi.Pointer<wasmtime_linker_t>, ffi.Pointer<wasmtime_context_t>, ffi.Pointer<wasmtime_module_t>, ffi.Pointer<wasmtime_instance_t>, ffi.Pointer<ffi.Pointer<wasm_trap_t>>)>()
Pointer<wasmtime_error_t> wasmtime_linker_instantiate(
  1. Pointer<wasmtime_linker_t> linker,
  2. Pointer<wasmtime_context_t> store,
  3. Pointer<wasmtime_module_t> module,
  4. Pointer<wasmtime_instance_t> instance,
  5. Pointer<Pointer<wasm_trap_t>> trap,
)

\brief Instantiates a #wasm_module_t with the items defined in this linker.

\param linker the linker used to instantiate the provided module. \param store the store that is used to instantiate within \param module the module that is being instantiated. \param instance the returned instance, if successful. \param trap a trap returned, if the start function traps.

\return One of three things can happen as a result of this function. First the module could be successfully instantiated and returned through instance, meaning the return value and trap are both set to NULL. Second the start function may trap, meaning the return value and instance are set to NULL and trap describes the trap that happens. Finally instantiation may fail for another reason, in which case an error is returned and trap and instance are set to NULL.

This function will attempt to satisfy all of the imports of the module provided with items previously defined in this linker. If any name isn't defined in the linker than an error is returned. (or if the previously defined item is of the wrong type).

Implementation

@ffi.Native<
  ffi.Pointer<wasmtime_error_t> Function(
    ffi.Pointer<wasmtime_linker_t>,
    ffi.Pointer<wasmtime_context_t>,
    ffi.Pointer<wasmtime_module_t>,
    ffi.Pointer<wasmtime_instance_t>,
    ffi.Pointer<ffi.Pointer<wasm_trap_t>>,
  )
>()
external ffi.Pointer<wasmtime_error_t> wasmtime_linker_instantiate(
  ffi.Pointer<wasmtime_linker_t> linker,
  ffi.Pointer<wasmtime_context_t> store,
  ffi.Pointer<wasmtime_module_t> module,
  ffi.Pointer<wasmtime_instance_t> instance,
  ffi.Pointer<ffi.Pointer<wasm_trap_t>> trap,
);