wasi library

Classes

WASI
Minimal WASI runtime interface.
WASIComponentAsyncCopyResult
Result of a canonical async stream memory copy operation.
WASIComponentAsyncEndpointHandles
Pair of canonical readable and writable endpoint handles.
WASIComponentAsyncHost
Binds decoded canonical stream/future definitions to executable primitives.
WASIComponentAsyncValueBinding
A decoded component stream/future type that can be bound to the async host.
WASIComponentAsyncValueMemoryLayout
Canonical ABI memory-copy layout for an async value payload.
WASIComponentBackpressure
Host-side Component Model async backpressure state.
WASIComponentCanonicalAdapterFlatCasePlan
Case in a flat Canonical ABI variant layout.
WASIComponentCanonicalAdapterFlatFieldPlan
Nested field in a flat Canonical ABI scalar layout.
WASIComponentCanonicalAdapterFlatValuePlan
Prepared flat Canonical ABI scalar layout for an adapter value.
WASIComponentCanonicalAdapterHost
Host for executable canonical lift/lower adapter operations.
WASIComponentCanonicalAdapterOperation
Executable direct value canonical adapter operation.
WASIComponentCanonicalAdapterPlan
Prepared canonical lift/lower adapter generation metadata.
WASIComponentCanonicalAdapterProgram
Canonical-indexed executable direct value adapter program.
WASIComponentCanonicalAdapterValuePlan
Planned value inside a canonical adapter signature.
WASIComponentCanonicalAsyncHandleProgram
Handle-backed stream/future-only canonical program for a decoded component.
WASIComponentCanonicalAsyncOperation
Executable form of a canonical stream/future operation.
WASIComponentCanonicalAsyncProgram
Executable stream/future-only canonical program for a decoded component.
WASIComponentCanonicalBindingPlan
Prepared canonical binding report for a decoded component.
WASIComponentCanonicalContextOperation
Executable form of a canonical context operation.
WASIComponentCanonicalContextProgram
Executable context-only canonical program for a decoded component.
WASIComponentCanonicalErrorContextOperation
Executable form of a canonical error-context operation.
WASIComponentCanonicalErrorContextProgram
Executable error-context-only canonical program for a decoded component.
WASIComponentCanonicalHost
Component Model canonical host facade.
WASIComponentCanonicalHostUnsupportedDefinition
One unsupported canonical definition found during host capability preflight.
WASIComponentCanonicalKindCapability
Host support report for one Component Model canonical kind.
WASIComponentCanonicalOperation
Bound canonical operation.
WASIComponentCanonicalProgram
Bound canonical program preserving component canonical index order.
WASIComponentCanonicalResourceOperation
Executable form of a canonical resource operation.
WASIComponentCanonicalResourceProgram
Executable resource-only canonical program for a decoded component.
WASIComponentCanonicalSubtaskOperation
Executable form of a canonical subtask operation.
WASIComponentCanonicalSubtaskProgram
Executable subtask canonical program for a decoded component.
WASIComponentCanonicalTaskOperation
Executable form of a canonical task.* operation.
WASIComponentCanonicalTaskProgram
Executable task-only canonical program for a decoded component.
WASIComponentCanonicalThreadOperation
Executable form of a supported canonical thread operation.
WASIComponentCanonicalThreadProgram
Executable supported-thread canonical program for a decoded component.
WASIComponentCanonicalValueMemoryCodec
Canonical ABI memory codec for one component value type.
WASIComponentCanonicalWaitableOperation
Executable form of a canonical waitable-set operation.
WASIComponentCanonicalWaitableProgram
Executable waitable-set canonical program for a decoded component.
WASIComponentContext
Thread-local storage for Component Model context.get/set.
WASIComponentContextHost
Host for canonical context.get and context.set operations.
WASIComponentCurrent<T extends Object>
Dynamic current-value storage for Component Model execution scopes.
WASIComponentErrorContext
Host-side representation of a Component Model error-context.
WASIComponentErrorContextHost
Binds canonical error-context.* definitions to a resource table.
WASIComponentFuture<T>
In-memory runtime state for a Component Model future<T> value.
WASIComponentHost
Component host adapter over shared WASI component primitives.
WASIComponentHostBinding
Bound component host state.
WASIComponentHostBindingError
A component host binding gap found before mutating host state.
WASIComponentHostBindingPlan
Prepared component host binding report.
WASIComponentMemoryString
Result of writing a canonical string to component memory.
WASIComponentReadableFuture<T>
Readable endpoint for WASIComponentFuture.
WASIComponentReadableStream<T>
Readable endpoint for WASIComponentStream.
WASIComponentResourceBinding
A decoded component resource type that can be bound to a host type.
WASIComponentResourceHost
Binds component resource type indexes to a WASI component resource table.
WASIComponentResourceTable
A typed resource table for WASI component hosts.
WASIComponentResourceType<T extends Object>
A nominal resource type for WASI component hosts.
WASIComponentResourceUse
One resource handle occurrence in a canonical adapter signature.
WASIComponentStream<T>
In-memory runtime state for a Component Model stream<T> value.
WASIComponentSubtask
Caller-side state for a Component Model subtask.
WASIComponentSubtaskHost
Table-backed host for canonical subtask operations.
WASIComponentTask
Callee-side state for Component Model task.* canonical operations.
WASIComponentTaskHost
Host for canonical task.* operations for the current component task.
WASIComponentThread
Host-side Component Model thread identity.
WASIComponentThreadHost
Host for thread identity and thread-local context canonical operations.
WASIComponentVersionedBindingPlan
Prepared versioned component binding report.
WASIComponentVersionedHost
Versioned component-host facade for WASI Preview2/Preview3 adapters.
WASIComponentVersionedWitWorldError
WIT world item or function rejected by a WASI version profile.
WASIComponentVersionedWitWorldPlan
Prepared WIT world ingestion report for one WASI version profile.
WASIComponentVersionProfile
Component canonical operation profile for one WASI version.
WASIComponentVersionSupportError
A canonical definition that is outside a WASI version profile.
WASIComponentWaitable
Host-side representation of a Component Model waitable.
WASIComponentWaitableEvent
A Canonical ABI waitable event tuple.
WASIComponentWaitableHost
Table-backed host for canonical waitable-set operations.
WASIComponentWaitableSet
A Component Model waitable set.
WASIComponentWitAdapterBindingError
WIT function signature that cannot bind to an executable adapter.
WASIComponentWitAdapterOperation
Executable WIT adapter operation.
WASIComponentWitAdapterParam
WIT adapter function parameter.
WASIComponentWitAdapterProgram
Executable WIT adapter program indexed by import/export function name.
WASIComponentWitAdapterRecordField
WIT adapter record field type.
WASIComponentWitAdapterSignature
Parsed subset of a WIT function signature that can drive adapters.
WASIComponentWitAdapterValueType
WIT value type supported by executable WIT adapters.
WASIComponentWitAdapterVariantCase
WIT adapter variant case type.
WASIComponentWitDiagnostic
Structured WIT parse diagnostic.
WASIComponentWitDocument
WIT document boundary model for Preview2/Preview3 adapters.
WASIComponentWitEnum
Enum type declared directly in a WIT interface.
WASIComponentWitFlags
Flags type declared directly in a WIT interface.
WASIComponentWitFunction
Function boundary declared directly in a WIT interface.
WASIComponentWitFunctionBinding
A WIT interface function expanded from a world boundary.
WASIComponentWitInterface
Top-level WIT interface boundary.
WASIComponentWitLabel
Label declared in a WIT flags or enum type.
WASIComponentWitPackage
Top-level package namespace:name@version; declaration.
WASIComponentWitRecord
Record type declared directly in a WIT interface.
WASIComponentWitRecordField
Field declared directly in a WIT record.
WASIComponentWitResolvedTarget
Standard or external WIT target resolved to a parsed document member.
WASIComponentWitResource
Resource type declared directly in a WIT interface.
WASIComponentWitSpan
Source span used for WIT diagnostics.
WASIComponentWitTarget
WIT world import/export target text.
WASIComponentWitTypeAlias
Type alias declared directly in a WIT interface.
WASIComponentWitUse
WIT use target.{items} declaration captured in an interface.
WASIComponentWitUseItem
One item inside a WIT use declaration.
WASIComponentWitVariant
Variant type declared directly in a WIT interface.
WASIComponentWitVariantCase
Case declared directly in a WIT variant.
WASIComponentWitWorld
Top-level WIT world boundary.
WASIComponentWitWorldItem
Import or export target declared directly in a WIT world.
WASIComponentWritableFuture<T>
Writable endpoint for WASIComponentFuture.
WASIComponentWritableStream<T>
Writable endpoint for WASIComponentStream.
WASIPreview1Socket
Host-side socket state for WASI Preview1 descriptors.
WASIPreview2CliHost
WASI 0.2 wasi:cli host imports.
WASIPreview2ClocksHost
WASI 0.2 wasi:clocks host imports.
WASIPreview2ComponentHost
WASI 0.2 / Preview2 component host boundary.
WASIPreview2FilesystemDirectory
Directory contents exposed through a WASI 0.2 filesystem preopen.
WASIPreview2FilesystemDirectoryEntry
One directory entry exposed by WASIPreview2FilesystemDirectory.
WASIPreview2FilesystemHost
WASI 0.2 wasi:filesystem host imports.
WASIPreview2FilesystemMetadata
Metadata returned by WASI 0.2 filesystem stat operations.
WASIPreview2FilesystemMutationResult
Result returned by Preview2 filesystem mutation callbacks.
WASIPreview2FilesystemReadLinkResult
Result returned by Preview2 filesystem readlink callbacks.
WASIPreview2FilesystemTimestampUpdate
Timestamp update requested by WASI 0.2 filesystem operations.
WASIPreview2InputStream
Host-owned WASI 0.2 input-stream.
WASIPreview2IoError
Host-owned WASI 0.2 wasi:io/error.error value.
WASIPreview2IoErrorHost
WASI 0.2 wasi:io/error host imports.
WASIPreview2IpAddress
IP address value returned by a Preview2 sockets resolver.
WASIPreview2NativeFilesystemHost
Placeholder for platforms without dart:io host filesystem access.
WASIPreview2OutputStream
Host-owned WASI 0.2 output-stream.
WASIPreview2Pollable
Readiness source for WASI 0.2 wasi:io/poll.pollable.
WASIPreview2PollHost
WASI 0.2 wasi:io/poll host imports.
WASIPreview2RandomHost
WASI 0.2 wasi:random host imports.
WASIPreview2SocketsHost
WASI 0.2 wasi:sockets host imports.
WASIPreview2StreamsHost
WASI 0.2 wasi:io/streams host imports.
WASIPreview3CliHost
WASI 0.3 wasi:cli host imports.
WASIPreview3ComponentHost
WASI 0.3 / Preview3 component host boundary.
WASIPreview3FilesystemDirectory
Directory contents exposed through a WASI 0.3 filesystem preopen.
WASIPreview3FilesystemDirectoryEntry
One directory entry exposed by WASIPreview3FilesystemDirectory.
WASIPreview3FilesystemHost
WASI 0.3 wasi:filesystem host imports.
WASIPreview3FilesystemMetadata
Metadata returned by WASI 0.3 filesystem stat operations.
WASIPreview3FilesystemMutationResult
Result returned by Preview3 filesystem mutation callbacks.
WASIPreview3FilesystemReadLinkResult
Result returned by Preview3 filesystem readlink callbacks.
WASIPreview3FilesystemTimestampUpdate
Timestamp update requested by WASI 0.3 filesystem operations.
WASIPreview3NativeFilesystemHost
Placeholder for platforms without dart:io host filesystem access.

Enums

WASIComponentAsyncCopyStatus
Status returned by canonical async stream memory copy operations.
WASIComponentAsyncEndpointFailure
Async endpoint failure category used by canonical copy event mapping.
WASIComponentAsyncValueBindingKind
Supported async value binding kind.
WASIComponentCanonicalAdapterFlatValueKind
Kind of prepared flat Canonical ABI scalar layout.
WASIComponentCanonicalCapabilityArea
Functional area covered by a Component Model canonical operation.
WASIComponentCanonicalStringEncoding
Canonical string encoding used by Component Model memory adapters.
WASIComponentResourceHandleKind
Ownership flavor of a resource handle in a canonical adapter signature.
WASIComponentResourceRepresentation
Core representation type for a component resource.
WASIComponentSubtaskState
Component Model subtask states.
WASIComponentTaskState
Callee-side Component Model task state.
WASIComponentWaitableEventCode
Component Model waitable event codes.
WASIComponentWitAdapterValueKind
WIT adapter value category.
WASIComponentWitWorldItemDirection
Direction of a WIT world boundary item.
WASIPreview2FilesystemDescriptorKind
WASI 0.2 filesystem object kind used by the Preview2 host.
WASIPreview2FilesystemMutationError
Filesystem mutation failures that map directly to WASI 0.2 error-code enum cases.
WASIPreview2IpAddressFamily
Address family for WASI 0.2 sockets.
WASIPreview3FilesystemDescriptorKind
WASI 0.3 filesystem object kind used by the Preview3 host.
WASIPreview3FilesystemMutationError
Filesystem mutation failures that map directly to WASI 0.3 error-code variants.
WASIProcessSignal
WASI Preview1 process signal values.
WASIVersion
WASI specification version.

Constants

wasiComponentAsyncBlocked → const int
Canonical return value used when an async copy has not produced an event yet.
wasiComponentContextSlotCount → const int
Current Canonical ABI limit for context.get/set indexes.
wasiComponentSubtaskBlocked → const int
Canonical return value used when a subtask operation has not resolved yet.

Functions

checkWASIComponentCanonicalStringRecordRange(Memory memory, int pointer, int elementCount) → void
Validates that elementCount contiguous (ptr, len) records fit in memory.
componentCanonicalAdapterPlans(WasmComponent component, {Iterable<WASIComponentResourceUse>? resourceUses}) List<WASIComponentCanonicalAdapterPlan>
Builds canonical lift/lower adapter plans for component.
isWASIComponentUnicodeScalar(int value) bool
Returns whether value is a Unicode scalar value.
readWASIComponentCanonicalString(Memory memory, int pointer, int canonicalLength, WASIComponentCanonicalStringEncoding encoding) String
Reads a canonical string payload from memory.
readWASIComponentCanonicalStringRecord(Memory memory, int pointer, WASIComponentCanonicalStringEncoding encoding) String
Reads a canonical (ptr, len) string record from memory.
singleWASIComponentUnicodeScalar(Object? value) int?
Returns the single Unicode scalar represented by value, or null.
wasiComponentWitAdapterBindingErrors(List<WASIComponentWitFunctionBinding> functions) List<WASIComponentWitAdapterBindingError>
Reports functions that cannot bind to executable adapters.
wasiComponentWitWorldFunctions(WASIComponentWitDocument document, WASIComponentWitWorld world, {WASIComponentWitTargetResolver? resolveTarget, Set<String>? visiting, String qualifyInterfaceName(String interfaceName)?}) List<WASIComponentWitFunctionBinding>
Expands local and resolved WIT import/export interface functions from world.
writeWASIComponentCanonicalString(Memory memory, WASIComponentCanonicalRealloc realloc, String value, WASIComponentCanonicalStringEncoding encoding) WASIComponentMemoryString
Writes a canonical string payload into memory through realloc.
writeWASIComponentMemoryStringRecord(Memory memory, int pointer, WASIComponentMemoryString result) → void
Writes a canonical (ptr, len) string record into memory.

Typedefs

WASIComponentCanonicalAdapterCallback = FutureOr<Object?> Function(List<Object?> args)
Function callback used by direct canonical adapter operations.
WASIComponentCanonicalRealloc = int Function(int oldPointer, int oldSize, int alignment, int newSize)
Canonical-style realloc callback used when lifting strings into memory.
WASIComponentWaitableResolver = WASIComponentWaitable? Function(int handle)
Resolves an externally owned component handle to a waitable, when possible.
WASIComponentWitAdapterCallback = FutureOr<Object?> Function(List<Object?> args)
Callback used by generated WIT adapter operations.
WASIComponentWitTargetResolver = WASIComponentWitResolvedTarget? Function(String target)
Resolves a qualified WIT target such as wasi:random/imports@0.3.0.
WASIPreview1SocketReceiveDataProvider = List<int> Function(int maxBytes)
Supplies stream bytes for a host-backed Preview1 socket.
WASIPreview1SocketReceiveMessageProvider = List<int>? Function()
Supplies one datagram message for a host-backed Preview1 socket.
WASIPreview1SocketSendHandler = int Function(Uint8List source, int sourceStart, int length)
Handles stream bytes written through a host-backed Preview1 socket.
WASIPreview1SocketSendMessageHandler = int Function(Uint8List message)
Handles one datagram message written through a host-backed Preview1 socket.
WASIPreview2AddressResolver = Iterable<WASIPreview2IpAddress> Function(String name)
Resolves a WASI socket name to zero or more IP addresses.
WASIPreview2FilesystemDirectoryEntriesProvider = Iterable<WASIPreview2FilesystemDirectoryEntry> Function()
Supplies the current entries for a filesystem directory.
WASIPreview2FilesystemDirectoryEntryResolver = WASIPreview2FilesystemDirectoryEntry? Function(String name)
Resolves one child entry by name without forcing a full directory scan.
WASIPreview2FilesystemDirectoryFileCreateCallback = WASIPreview2FilesystemDirectoryEntry? Function(String name)
Creates and returns one regular-file entry inside a directory.
WASIPreview2FilesystemDirectoryLinkCallback = WASIPreview2FilesystemMutationResult Function(String oldName, WASIPreview2FilesystemDirectory targetDirectory, String newName)
Links one child from this directory into targetDirectory.
WASIPreview2FilesystemDirectoryMutationCallback = WASIPreview2FilesystemMutationResult Function(String name)
Mutates one child entry inside a directory.
WASIPreview2FilesystemDirectoryReadLinkCallback = WASIPreview2FilesystemReadLinkResult Function(String name)
Reads a symbolic link target for a child entry.
WASIPreview2FilesystemDirectoryRenameCallback = WASIPreview2FilesystemMutationResult Function(String oldName, WASIPreview2FilesystemDirectory targetDirectory, String newName)
Renames one child from this directory into targetDirectory.
WASIPreview2FilesystemDirectorySymlinkCallback = WASIPreview2FilesystemMutationResult Function(String target, String linkName)
Creates a symbolic link entry.
WASIPreview2FilesystemFileBytesProvider = Uint8List Function(BigInt offset)
Reads regular-file bytes starting at a byte offset.
WASIPreview2FilesystemFileSetSizeCallback = WASIPreview2FilesystemMutationResult Function(BigInt size)
Changes the byte length of a regular file.
WASIPreview2FilesystemFileSizeProvider = BigInt Function()
Supplies the current byte length for a regular file.
WASIPreview2FilesystemFileWriteCallback = WASIPreview2FilesystemMutationResult Function(BigInt offset, Uint8List bytes)
Writes regular-file bytes starting at byte offset.
WASIPreview2FilesystemMetadataProvider = WASIPreview2FilesystemMetadata Function()
Supplies current descriptor metadata for stat operations.
WASIPreview2FilesystemSetTimesCallback = WASIPreview2FilesystemMutationResult Function(WASIPreview2FilesystemTimestampUpdate update)
Updates access and modification timestamps for one filesystem object.
WASIPreview3CliOutputHandler = void Function(Uint8List bytes)
Receives bytes written by WASI 0.3 CLI stdout or stderr streams.
WASIPreview3FilesystemDirectoryEntriesProvider = Iterable<WASIPreview3FilesystemDirectoryEntry> Function()
Supplies the current entries for a filesystem directory.
WASIPreview3FilesystemDirectoryEntryResolver = WASIPreview3FilesystemDirectoryEntry? Function(String name)
Resolves one child entry by name without forcing a full directory scan.
WASIPreview3FilesystemDirectoryFileCreateCallback = WASIPreview3FilesystemDirectoryEntry? Function(String name)
Creates and returns one regular-file entry inside a directory.
WASIPreview3FilesystemDirectoryLinkCallback = WASIPreview3FilesystemMutationResult Function(String oldName, WASIPreview3FilesystemDirectory targetDirectory, String newName)
Links one child from this directory into targetDirectory.
WASIPreview3FilesystemDirectoryMutationCallback = WASIPreview3FilesystemMutationResult Function(String name)
Mutates one child entry inside a directory.
WASIPreview3FilesystemDirectoryReadLinkCallback = WASIPreview3FilesystemReadLinkResult Function(String name)
Reads a symbolic link target for a child entry.
WASIPreview3FilesystemDirectoryRenameCallback = WASIPreview3FilesystemMutationResult Function(String oldName, WASIPreview3FilesystemDirectory targetDirectory, String newName)
Renames one child from this directory into targetDirectory.
WASIPreview3FilesystemDirectorySymlinkCallback = WASIPreview3FilesystemMutationResult Function(String target, String linkName)
Creates a symbolic link entry.
WASIPreview3FilesystemFileBytesProvider = Uint8List Function(BigInt offset)
Reads regular-file bytes starting at a byte offset.
WASIPreview3FilesystemFileSetSizeCallback = WASIPreview3FilesystemMutationResult Function(BigInt size)
Changes the byte length of a regular file.
WASIPreview3FilesystemFileSizeProvider = BigInt Function()
Supplies the current byte length for a regular file.
WASIPreview3FilesystemFileWriteCallback = WASIPreview3FilesystemMutationResult Function(BigInt offset, Uint8List bytes)
Writes regular-file bytes starting at byte offset.
WASIPreview3FilesystemMetadataProvider = WASIPreview3FilesystemMetadata Function()
Supplies current descriptor metadata for stat operations.
WASIPreview3FilesystemSetTimesCallback = WASIPreview3FilesystemMutationResult Function(WASIPreview3FilesystemTimestampUpdate update)
Updates access and modification timestamps for one filesystem object.
WASIProcRaiseHandler = void Function(WASIProcessSignal signal)
Handles a WASI Preview1 proc_raise signal.

Exceptions / Errors

WASIComponentAsyncEndpointStateError
State error carrying the canonical async endpoint failure kind.
WASIComponentCanonicalHostAdapterException
Thrown when canonical lift/lower lacks an executable adapter operation.
WASIComponentCanonicalHostUnsupportedException
Thrown when canonical definitions require unsupported host capabilities.
WASIComponentCanonicalHostValidationException
Thrown when a decoded component fails validation before canonical binding.
WASIComponentHostBindingException
Thrown when the component host lacks required binding state.
WASIComponentVersionedWitWorldUnsupportedException
Thrown when WIT world ingestion fails the selected WASI version profile.
WASIComponentVersionUnsupportedException
Thrown when a component uses canonical operations outside a WASI profile.
WASIComponentWitAdapterBindingException
Thrown when a WIT world cannot produce executable adapter bindings.
WASIComponentWitParseException
Exception thrown when WIT boundary parsing fails.
WASIPreview2Exit
Exception used to terminate a WASI 0.2 command instance.
WASIPreview3Exit
Exception used to terminate a WASI 0.3 command instance.