fromValueType static method

Builds a Canonical ABI memory codec for type.

Returns null when type contains component resource handles, borrows, nested stream/future values, or an invalid type index.

Implementation

static WASIComponentCanonicalValueMemoryCodec? fromValueType(
  WasmComponentValueType type,
  List<WasmComponentTypeDefinition> definitions,
) {
  final layout = _LayoutResolver(definitions).resolveValueType(type);
  return layout == null
      ? null
      : WASIComponentCanonicalValueMemoryCodec._(layout);
}