WasmLibrary class

A WasmLibrary is a wrapper around a WasmInstance that provides convenience methods for interacting with the instance that implements the WASM component model.

Constructors

WasmLibrary(WasmInstance instance, {String componentId = '', StringEncoding stringEncoding = StringEncoding.utf8, Int64TypeConfig int64Type = Int64TypeConfig.bigInt, WasmMemory? wasmMemory})
A WasmLibrary is a wrapper around a WasmInstance that provides convenience methods for interacting with the instance that implements the WASM component model.

Properties

componentInstance ComponentInstance
The ComponentInstance for tracking handles and checking invariants.
final
hashCode int
The hash code for this object.
no setterinherited
instance WasmInstance
The WasmInstance that implements the WASM component model.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringEncoding StringEncoding
The StringEncoding to use for strings.
final
wasmMemory WasmMemory
The WasmMemory for this instance.
final

Methods

getComponentFunction(String name, FuncType ft) ListValue Function(ListValue args)?
Returns a Function that can be used to call the component function with the given name and ft (FuncType). The function is constructed by flattening the ft and then calling canon_lift to create a function that can be called with a list of core Wasm FlatValues.
getComponentFunctionWorker(String name, FuncType ft) Future<ListValue> Function(ListValue args)?
Returns a Function that can be used to call the component function with the given name and ft (FuncType). The function is constructed by flattening the ft and then calling canon_lift to create a function that can be called with a list of core Wasm FlatValues.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postReturnFunction(String functionName) → void Function(List<FlatValue>)?
realloc(int ptr, int sizeInitial, int alignment, int sizeFinal) int
Reallocates a section of memory to a new size. May be used to grow or shrink the memory.
toString() String
A string representation of this object.
inherited
withContext<T>(T fn()) → T

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

currentZoneLibrary() WasmLibrary?