diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6752384..431b96b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,6 +11,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: WebAssembly/wit-abi-up-to-date@v21 + - uses: WebAssembly/wit-abi-up-to-date@v22 with: - wit-bindgen: '0.28.0' + wit-bindgen: '0.33.0' diff --git a/imports.md b/imports.md index da7edcb..da344c7 100644 --- a/imports.md +++ b/imports.md @@ -1,17 +1,17 @@ -
wasi:io/error@0.2.1
wasi:io/poll@0.2.1
wasi:io/streams@0.2.1
wasi:io/error@0.2.2
wasi:io/poll@0.2.2
wasi:io/streams@0.2.2
resource error
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.
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
+[method]error.to-debug-string: func
Returns a string that is suitable to assist humans in debugging
this error.
WARNING: The returned string should not be consumed mechanically!
@@ -35,41 +35,41 @@ details. Parsing this string is a major platform-compatibility
hazard.
Params
Return values
-Import interface wasi:io/poll@0.2.1
+Import interface wasi:io/poll@0.2.2
A poll API intended to let users wait for I/O events on multiple handles
at once.
Types
-resource pollable
+resource pollable
pollable
represents a single I/O event which may be ready, or not.
Functions
-[method]pollable.ready: func
+[method]pollable.ready: func
Return the readiness of a pollable. This function never blocks.
Returns true
when the pollable is ready, and false
otherwise.
Params
Return values
-[method]pollable.block: func
+[method]pollable.block: func
block
returns immediately if the pollable is ready, and otherwise
blocks until ready.
This function is equivalent to calling poll.poll
on a list
containing only this pollable.
Params
-poll: func
+poll: func
Poll for completion on a set of pollables.
This function takes a list of pollables, which identify I/O sources of
interest, and waits until one or more of the events is ready for I/O.
@@ -88,44 +88,44 @@ the pollables has an error, it is indicated by marking the source as
being ready for I/O.
Params
Return values
-Import interface wasi:io/streams@0.2.1
+Import interface wasi:io/streams@0.2.2
WASI I/O is an I/O abstraction API which is currently focused on providing
stream types.
In the future, the component model is expected to add built-in stream types;
when it does, they are expected to subsume this API.
Types
-type error
+type error
-#### `type pollable`
+#### `type pollable`
[`pollable`](#pollable)
-#### `variant stream-error`
+#### `variant stream-error`
An error for input-stream and output-stream operations.
Variant Cases
-
-
last-operation-failed
: own<error
>
+last-operation-failed
: own<error
>
The last operation (a write or flush) failed before completion.
More information is available in the error
payload.
After this, the stream will be closed. All future operations return
stream-error::closed
.
-
-
+
The stream is closed: no more input will be accepted by the
stream. A closed output-stream will return this error on all
future operations.
-resource input-stream
+resource input-stream
An input bytestream.
input-stream
s are non-blocking to the extent practical on underlying
platforms. I/O operations always return promptly; if fewer bytes are
@@ -133,7 +133,7 @@ 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
+resource output-stream
An output bytestream.
output-stream
s are non-blocking to the extent practical on
underlying platforms. Except where specified otherwise, I/O operations also
@@ -145,7 +145,7 @@ polled for using wasi:io/poll
.
progress may result in the data being lost. Before dropping the stream,
be sure to fully flush your writes.
Functions
-[method]input-stream.read: func
+[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
@@ -169,51 +169,51 @@ as a return value by the callee. The callee may return a list of bytes
less than len
in size while more bytes are available for reading.
Params
-self
: borrow<input-stream
>
-len
: u64
+self
: borrow<input-stream
>
+len
: u64
Return values
-- result<list<
u8
>, stream-error
>
+- result<list<
u8
>, stream-error
>
-[method]input-stream.blocking-read: func
+[method]input-stream.blocking-read: func
Read bytes from a stream, after blocking until at least one byte can
be read. Except for blocking, behavior is identical to read
.
Params
-self
: borrow<input-stream
>
-len
: u64
+self
: borrow<input-stream
>
+len
: u64
Return values
-- result<list<
u8
>, stream-error
>
+- result<list<
u8
>, stream-error
>
-[method]input-stream.skip: func
+[method]input-stream.skip: func
Skip bytes from a stream. Returns number of bytes skipped.
Behaves identical to read
, except instead of returning a list
of bytes, returns the number of bytes consumed from the stream.
Params
-self
: borrow<input-stream
>
-len
: u64
+self
: borrow<input-stream
>
+len
: u64
Return values
-- result<
u64
, stream-error
>
+- result<
u64
, stream-error
>
-[method]input-stream.blocking-skip: func
+[method]input-stream.blocking-skip: func
Skip bytes from a stream, after blocking until at least one byte
can be skipped. Except for blocking behavior, identical to skip
.
Params
-self
: borrow<input-stream
>
-len
: u64
+self
: borrow<input-stream
>
+len
: u64
Return values
-- result<
u64
, stream-error
>
+- result<
u64
, stream-error
>
-[method]input-stream.subscribe: func
+[method]input-stream.subscribe: func
Create a pollable
which will resolve once either the specified stream
has bytes available to read or the other end of the stream has been
closed.
@@ -222,13 +222,13 @@ Implementations may trap if the input-stream
pollable
s created with this function are dropped.
Params
-self
: borrow<input-stream
>
+self
: borrow<input-stream
>
Return values
-[method]output-stream.check-write: func
+[method]output-stream.check-write: func
Check readiness for writing. This function never blocks.
Returns the number of bytes permitted for the next call to write
,
or an error. Calling write
with more bytes than this function has
@@ -238,13 +238,13 @@ become ready when this function will report at least 1 byte, or an
error.
Params
-self
: borrow<output-stream
>
+self
: borrow<output-stream
>
Return values
-- result<
u64
, stream-error
>
+- result<
u64
, stream-error
>
-[method]output-stream.write: func
+[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
@@ -257,14 +257,14 @@ length of less than or equal to n. Otherwise, this function will trap.
the last call to check-write provided a permit.
Params
-self
: borrow<output-stream
>
-contents
: list<u8
>
+self
: borrow<output-stream
>
+contents
: list<u8
>
Return values
-- result<_,
stream-error
>
+- result<_,
stream-error
>
-[method]output-stream.blocking-write-and-flush: func
+[method]output-stream.blocking-write-and-flush: func
Perform a write of up to 4096 bytes, and then flush the stream. Block
until all of these operations are complete, or an error occurs.
This is a convenience wrapper around the use of check-write
,
@@ -288,14 +288,14 @@ let _ = this.check-write(); // eliding error handling
self
: borrow<output-stream
>contents
: list<u8
>self
: borrow<output-stream
>contents
: list<u8
>stream-error
>stream-error
>[method]output-stream.flush: func
[method]output-stream.flush: func
Request to flush buffered output. This function never blocks.
This tells the output-stream that the caller intends any buffered
output to be flushed. the output which is expected to be flushed
@@ -306,24 +306,24 @@ completed. The subscribe
pollable will become ready when the
flush has completed and the stream can accept more writes.
self
: borrow<output-stream
>self
: borrow<output-stream
>stream-error
>stream-error
>[method]output-stream.blocking-flush: func
[method]output-stream.blocking-flush: func
Request to flush buffered output, and block until flush completes and stream is ready for writing again.
self
: borrow<output-stream
>self
: borrow<output-stream
>stream-error
>stream-error
>[method]output-stream.subscribe: func
[method]output-stream.subscribe: func
Create a pollable
which will resolve once the output-stream
is ready for more writing, or an error has occurred. When this
pollable is ready, check-write
will return ok(n)
with n>0, or an
@@ -334,13 +334,13 @@ Implementations may trap if the output-stream
s created with this function are dropped.pollable
self
: borrow<output-stream
>self
: borrow<output-stream
>[method]output-stream.write-zeroes: func
[method]output-stream.write-zeroes: func
Write zeroes to a stream.
This should be used precisely like write
with the exact same
preconditions (must use check-write first), but instead of
@@ -348,14 +348,14 @@ passing a list of bytes, you simply pass the number of zero-bytes
that should be written.
self
: borrow<output-stream
>len
: u64
self
: borrow<output-stream
>len
: u64
stream-error
>stream-error
>[method]output-stream.blocking-write-zeroes-and-flush: func
[method]output-stream.blocking-write-zeroes-and-flush: func
Perform a write of up to 4096 zeroes, and then flush the stream. Block until all of these operations are complete, or an error occurs.
@@ -379,14 +379,14 @@ let _ = this.check-write(); // eliding error handlingself
: borrow<output-stream
>len
: u64
self
: borrow<output-stream
>len
: u64
stream-error
>stream-error
>[method]output-stream.splice: func
[method]output-stream.splice: func
Read from one stream and write to another.
The behavior of splice is equivalent to:
len
.
self
: borrow<output-stream
>src
: borrow<input-stream
>len
: u64
self
: borrow<output-stream
>src
: borrow<input-stream
>len
: u64
u64
, stream-error
>u64
, stream-error
>[method]output-stream.blocking-splice: func
[method]output-stream.blocking-splice: func
Read from one stream and write to another, with blocking.
This is similar to splice
, except that it blocks until the
output-stream
is ready for writing, and the input-stream
is ready for reading, before performing the splice
.
self
: borrow<output-stream
>src
: borrow<input-stream
>len
: u64
self
: borrow<output-stream
>src
: borrow<input-stream
>len
: u64
u64
, stream-error
>u64
, stream-error
>