From d2016238b192371712d83bc0bbc8e5b8adf81927 Mon Sep 17 00:00:00 2001
From: Bailey Hayes A resource which represents some error information. The only method provided by this resource is In the To provide more specific error information, other interfaces may
+provide functions to further "downcast" this error into more specific
+error information. For example, Returns a string that is suitable to assist humans in debugging
@@ -29,13 +43,13 @@ hazard. A poll API intended to let users wait for I/O events on multiple handles
at once. Return the readiness of a pollable. This function never blocks.
-
-
wasi:io/error@0.2.0-rc-2023-11-10
wasi:io/poll@0.2.0-rc-2023-11-10
wasi:io/streams@0.2.0-rc-2023-11-10
wasi:io/error@0.2.0-rc-2023-12-05
wasi:io/poll@0.2.0-rc-2023-12-05
wasi:io/streams@0.2.0-rc-2023-12-05
Import interface wasi:io/error@0.2.0-rc-2023-11-10
+Import interface wasi:io/error@0.2.0-rc-2023-12-05
Types
-resource error
+to-debug-string
,
+which provides some human-readable information about the error.wasi:io
package, this resource is returned through the
+wasi:io/streams/stream-error
type.error
s 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
Import interface wasi:io/poll@0.2.0-rc-2023-11-10
+Import interface wasi:io/poll@0.2.0-rc-2023-12-05
Types
-resource pollable
+pollable
represents a single I/O event which may be ready, or not.Functions
[method]pollable.ready: func
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; @@ -109,8 +123,21 @@ future operations.
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
+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-stream
s 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
.[method]input-stream.read: func
Perform a non-blocking read from the stream.
diff --git a/wit/error.wit b/wit/error.wit index 31918ac..7a25de9 100644 --- a/wit/error.wit +++ b/wit/error.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.0-rc-2023-11-10; +package wasi:io@0.2.0-rc-2023-12-05; interface error { diff --git a/wit/poll.wit b/wit/poll.wit index 81b1cab..ae9d643 100644 --- a/wit/poll.wit +++ b/wit/poll.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.0-rc-2023-11-10; +package wasi:io@0.2.0-rc-2023-12-05; /// A poll API intended to let users wait for I/O events on multiple handles /// at once. diff --git a/wit/streams.wit b/wit/streams.wit index f6f7fe0..84fccd8 100644 --- a/wit/streams.wit +++ b/wit/streams.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.0-rc-2023-11-10; +package wasi:io@0.2.0-rc-2023-12-05; /// WASI I/O is an I/O abstraction API which is currently focused on providing /// stream types. diff --git a/wit/world.wit b/wit/world.wit index 8243da2..1dbc0e2 100644 --- a/wit/world.wit +++ b/wit/world.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.0-rc-2023-11-10; +package wasi:io@0.2.0-rc-2023-12-05; world imports { import streams;