diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b456232..b944a0d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,5 +10,5 @@ jobs: name: Check ABI files are up-to-date runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: WebAssembly/wit-abi-up-to-date@v16 + - uses: actions/checkout@v4 + - uses: WebAssembly/wit-abi-up-to-date@v17 diff --git a/imports.md b/imports.md index 6900a88..84d2c0f 100644 --- a/imports.md +++ b/imports.md @@ -12,7 +12,21 @@

Types

resource error

-
+

A resource which represents some error information.

+

The only method provided by this resource is to-debug-string, +which provides some human-readable information about the error.

+

In the wasi:io package, this resource is returned through the +wasi:io/streams/stream-error type.

+

To provide more specific error information, other interfaces may +provide functions to further "downcast" this error into more specific +error information. For example, errors returned in streams derived +from filesystem types to be described using the filesystem's own +error-code type, using the function +wasi:filesystem/types/filesystem-error-code, which takes a parameter +borrow<error> and returns +option<wasi:filesystem/types/error-code>.

+

The set of functions which can "downcast" an error into a more +concrete type is open.

Functions

[method]error.to-debug-string: func

Returns a string that is suitable to assist humans in debugging @@ -35,7 +49,7 @@ at once.


Types

resource pollable

-
+

pollable epresents a single I/O event which may be ready, or not.

Functions

[method]pollable.ready: func

Return the readiness of a pollable. This function never blocks.

@@ -109,11 +123,28 @@ future operations.

resource input-stream

+

An input bytestream.

+

input-streams are non-blocking to the extent practical on underlying +platforms. I/O operations always return promptly; if fewer bytes are +promptly available than requested, they return the number of bytes promptly +available, which could even be zero. To wait for data to be available, +use the subscribe function to obtain a pollable which can be polled +for using wasi:io/poll.

resource output-stream

-
+

An output bytestream.

+

output-streams are non-blocking to the extent practical on +underlying platforms. Except where specified otherwise, I/O operations also +always return promptly, after the number of bytes that can be written +promptly, which could even be zero. To wait for the stream to be ready to +accept data, the subscribe function to obtain a pollable which can be +polled for using wasi:io/poll.

Functions

[method]input-stream.read: func

Perform a non-blocking read from the stream.

+

When the source of a read is binary data, the bytes from the source +are returned verbatim. When the source of a read is known to the +implementation to be text, bytes containing the UTF-8 encoding of the +text are returned.

This function returns a list of bytes containing the read data, when successful. The returned list will contain up to len bytes; it may return fewer than requested, but not more. The list is @@ -209,6 +240,11 @@ error.

[method]output-stream.write: func

Perform a write. This function never blocks.

+

When the destination of a write is binary data, the bytes from +contents are written verbatim. When the destination of a write is +known to the implementation to be text, the bytes of contents are +transcoded from UTF-8 into the encoding of the destination and then +written.

Precondition: check-write gave permit of Ok(n) and contents has a length of less than or equal to n. Otherwise, this function will trap.

returns Err(closed) without writing if the stream has closed since