WASIComponentCanonicalValueMemoryCodec class final

Canonical ABI memory codec for one component value type.

It implements the Canonical ABI alignment/elem_size/load/store path used by stream/future copy buffers. Dynamic string/list values are represented by their canonical (ptr, len) record and use WASIComponentCanonicalRealloc when storing payloads. Resource handle-table semantics and borrow tracking are reported as unsupported instead of being approximated. Resource and error-context handles can be represented as plain canonical u32 values when the caller supplies a handle-aware adapter plan. Owned resource handles can also use that same canonical u32 memory representation for stream/future element copy buffers.

Properties

alignment → int
Required guest-memory pointer alignment for one value.
no setter
byteLength → int
Number of guest-memory bytes occupied by one value.
no setter
hashCode → int
The hash code for this object.
no setterinherited
primitive → WasmComponentPrimitiveValueType?
Primitive type for primitive layouts; otherwise null.
no setter
requiresRealloc → bool
Whether storing this value may need a canonical realloc callback.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

load(Memory memory, int pointer, {WASIComponentCanonicalStringEncoding stringEncoding = WASIComponentCanonicalStringEncoding.utf8}) → Object?
Loads one value from memory at pointer.
loadAs<T>(Memory memory, int pointer, String name, {WASIComponentCanonicalStringEncoding stringEncoding = WASIComponentCanonicalStringEncoding.utf8}) → T
Loads one typed value from memory at pointer.
loadFlatList(Memory memory, int pointer, int length, {WASIComponentCanonicalStringEncoding stringEncoding = WASIComponentCanonicalStringEncoding.utf8}) → WasmComponentValueData
Loads a dynamic list value from a flat Canonical ABI (ptr, len) pair.
loadMany(Memory memory, int pointer, int elementCount, {WASIComponentCanonicalStringEncoding stringEncoding = WASIComponentCanonicalStringEncoding.utf8}) → List<Object?>
Loads elementCount contiguous values from memory.
loadManyAs<T>(Memory memory, int pointer, int elementCount, String name, {WASIComponentCanonicalStringEncoding stringEncoding = WASIComponentCanonicalStringEncoding.utf8}) → List<T>
Loads elementCount typed contiguous values from memory.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
store(Memory memory, int pointer, Object? value, {WASIComponentCanonicalRealloc? realloc, WASIComponentCanonicalStringEncoding stringEncoding = WASIComponentCanonicalStringEncoding.utf8}) → void
Stores one value into memory at pointer.
storeFlatList(Memory memory, Object? value, {WASIComponentCanonicalRealloc? realloc, WASIComponentCanonicalStringEncoding stringEncoding = WASIComponentCanonicalStringEncoding.utf8}) → ({int length, int pointer})
Stores a dynamic list value and returns its flat (ptr, len) pair.
storeMany(Memory memory, int pointer, List<Object?> values, {WASIComponentCanonicalRealloc? realloc, WASIComponentCanonicalStringEncoding stringEncoding = WASIComponentCanonicalStringEncoding.utf8}) → void
Stores contiguous values into memory.
toString() → String
A string representation of this object.
inherited
validate(String name, Object? value) → void
Validates value against this canonical value shape.

Operators

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

Static Methods

fromAdapterValueType(WasmComponentValueType type, List<WasmComponentTypeDefinition> definitions, {WasmComponentTypeScope? typeScope}) → WASIComponentCanonicalValueMemoryCodec?
Builds a Canonical ABI memory codec for adapter value boundaries.
fromAsyncElementType(WasmComponentValueType type, List<WasmComponentTypeDefinition> definitions) → WASIComponentCanonicalValueMemoryCodec?
Builds a Canonical ABI memory codec for stream/future element buffers.
fromValueType(WasmComponentValueType type, List<WasmComponentTypeDefinition> definitions) → WASIComponentCanonicalValueMemoryCodec?
Builds a Canonical ABI memory codec for type.

Constants

canonicalU32Handle → const WASIComponentCanonicalValueMemoryCodec
Canonical memory codec for handle values represented as u32.