Function wasmer_c_api::wasm_c_api::instance::wasm_instance_new[][src]

#[no_mangle]pub unsafe extern "C" fn wasm_instance_new(
    _store: Option<&wasm_store_t>,
    module: Option<&wasm_module_t>,
    imports: Option<&wasm_extern_vec_t>,
    traps: *mut *mut wasm_trap_t
) -> Option<Box<wasm_instance_t>>

Creates a new instance from a WebAssembly module and a set of imports.

Errors

The function can fail in 2 ways:

  1. Link errors that happen when plugging the imports into the instance,
  2. Runtime errors that happen when running the module start function.

Failures are stored in the traps argument; the program doesn't panic.

Notes

The store argument is ignored. The store from the given module will be used.

Example

See the module's documentation.