WasmInstanceBuilder class abstract
Constructs a new WasmInstance from a WasmModule by adding imports with addImport and constructing other WasmExternal values (createMemory, createGlobal or createTable). You may use WasmModule.builder to create a new WasmInstanceBuilder. To instantiate this builder you may use WasmInstanceBuilder.build or WasmInstanceBuilder.build.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- module → WasmModule
-
The wasm module associated with this instance builder.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addImport(
String moduleName, String name, WasmExternal value) → WasmInstanceBuilder -
Adds a new import to the module.
May throw if the import is not found or the type definition
does not match
value
. -
addImports(
List< WasmImport> imports) → WasmInstanceBuilder - Adds multiple imports to the module. May throw if some of the imports are not found or the type definition does not match the import value.
-
build(
) → Future< WasmInstance> - Builds the instance asynchronously. May throw if some required imports where not supplied.
-
buildSync(
) → WasmInstance - Builds the instance synchronously. May throw if some required imports where not supplied.
-
createGlobal(
WasmValue value, {required bool mutable}) → WasmGlobal -
Creates a new global with
value
and themutable
flag. -
createMemory(
{required int minPages, int? maxPages}) → WasmMemory -
Creates a new memory with
minPages
andmaxPages
pages. -
createTable(
{required WasmValue value, required int minSize, int? maxSize}) → WasmTable -
Creates a new table with
minSize
andmaxSize
elements. -
fuel(
) → WasmInstanceFuel? - Returns the fuel that can be used to limit the amount of computations performed by the instance.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited