WasmInstance class abstract
The module instance that was created from a module and can be used to call functions with getFunction or access any of the exports. You can limit the execution of the module with fuel. You may use WasmModule.builder to create a new WasmInstanceBuilder and then WasmInstanceBuilder.build to construct a WasmInstance.
Constructors
Properties
-
exports
→ Map<
String, WasmExternal> -
The exports of this instance.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- module → WasmModule
-
The module that was used to create this instance.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stderr
→ Stream<
Uint8List> -
When using WASI with WasiConfig in WasmModule.builder,
this is the stderr stream.
no setter
-
stdout
→ Stream<
Uint8List> -
When using WASI with WasiConfig in WasmModule.builder,
this is the stdout stream.
no setter
Methods
-
dispose(
) → void - Frees up resources used by this instance.
-
fuel(
) → WasmInstanceFuel? - Returns the fuel that can be used to limit the amount of computations performed by the instance.
-
getExportTyped<
T extends WasmExternal> (String name) → T? -
Returns the export with
name
if it is of typeT
. -
getFunction(
String name) → WasmFunction? -
Returns the function with
name
if it exists. -
getGlobal(
String name) → WasmGlobal? -
Returns the global with
name
if it exists. -
getMemory(
String name) → WasmMemory? -
Returns the memory with
name
if it exists. -
getTable(
String name) → WasmTable? -
Returns the table with
name
if it exists. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
runParallel(
WasmFunction function, List< List< argsLists) → Future<Object?> >List< List< >Object?> > -
Executes
function
withargsLists
in parallel and returns the result. Each list inargsLists
will be passed tofunction
as arguments to be executed as a task in parallel. The native implementation uses Rust's rayon crate to execute tasks with a work-stealing scheduler. -
toString(
) → String -
A string representation of this object.
override
-
wasiOpenFile(
String path, {bool create = false, bool truncate = false, bool exclusive = false}) → Future< WasiFile?> -
Opens a file with
path
and returns a WasiFile if it exists.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited