2
2
<ul >
3
3
<li >Imports:
4
4
<ul >
5
- <li >interface <a href =" #wasi:io_poll " ><code >wasi:io/poll</code ></a ></li >
6
- <li >interface <a href =" #wasi:io_streams " ><code >wasi:io/streams</code ></a ></li >
5
+ <
li >interface <
a href =
" #wasi:io_error_0.2.0_rc_2023_11_10 " ><
code >wasi:io/
[email protected] </
code ></
a ></
li >
6
+ <
li >interface <
a href =
" #wasi:io_poll_0.2.0_rc_2023_11_10 " ><
code >wasi:io/
[email protected] </
code ></
a ></
li >
7
+ <
li >interface <
a href =
" #wasi:io_streams_0.2.0_rc_2023_11_10 " ><
code >wasi:io/
[email protected] </
code ></
a ></
li >
7
8
<li >interface <a href =" #wasi:keyvalue_wasi_cloud_error " ><code >wasi:keyvalue/wasi-cloud-error</code ></a ></li >
8
9
<li >interface <a href =" #wasi:keyvalue_types " ><code >wasi:keyvalue/types</code ></a ></li >
9
10
<li >interface <a href =" #wasi:keyvalue_readwrite " ><code >wasi:keyvalue/readwrite</code ></a ></li >
17
18
</ul >
18
19
</li >
19
20
</ul >
20
- <h2 ><a name =" wasi:io_poll " >Import interface wasi:io/poll</a ></h2 >
21
+ <
h2 ><
a name =
" wasi:io_error_0.2.0_rc_2023_11_10 " >Import interface wasi:io/
[email protected] </
a ></
h2 >
22
+ <hr />
23
+ <h3 >Types</h3 >
24
+ <h4 ><a name =" error " ><code >resource error</code ></a ></h4 >
25
+ <p >A resource which represents some error information.</p >
26
+ <p >The only method provided by this resource is <code >to-debug-string</code >,
27
+ which provides some human-readable information about the error.</p >
28
+ <p >In the <code >wasi:io</code > package, this resource is returned through the
29
+ <code >wasi: io /streams/stream-error</code > type.</p >
30
+ <p >To provide more specific error information, other interfaces may
31
+ provide functions to further " ; downcast" ; this error into more specific
32
+ error information. For example, <a href =" #error " ><code >error</code ></a >s returned in streams derived
33
+ from filesystem types to be described using the filesystem's own
34
+ error-code type, using the function
35
+ <code >wasi: filesystem /types/filesystem-error-code</code >, which takes a parameter
36
+ <code >borrow< ; error> ; </code > and returns
37
+ <code >option< ; wasi: filesystem /types/error-code> ; </code >.</p >
38
+ <h2 >The set of functions which can " ; downcast" ; an <a href =" #error " ><code >error</code ></a > into a more
39
+ concrete type is open.</h2 >
40
+ <h3 >Functions</h3 >
41
+ <h4 ><a name =" method_error.to_debug_string " ><code >[method]error.to-debug-string: func</code ></a ></h4 >
42
+ <p >Returns a string that is suitable to assist humans in debugging
43
+ this error.</p >
44
+ <p >WARNING: The returned string should not be consumed mechanically!
45
+ It may change across platforms, hosts, or other implementation
46
+ details. Parsing this string is a major platform-compatibility
47
+ hazard.</p >
48
+ <h5 >Params</h5 >
49
+ <ul >
50
+ <li ><a name =" method_error.to_debug_string.self " ><code >self</code ></a >: borrow< ; <a href =" #error " ><a href =" #error " ><code >error</code ></a ></a >> ; </li >
51
+ </ul >
52
+ <h5 >Return values</h5 >
53
+ <ul >
54
+ <li ><a name =" method_error.to_debug_string.0 " ></a > <code >string</code ></li >
55
+ </ul >
56
+ <
h2 ><
a name =
" wasi:io_poll_0.2.0_rc_2023_11_10 " >Import interface wasi:io/
[email protected] </
a ></
h2 >
21
57
<p >A poll API intended to let users wait for I/O events on multiple handles
22
58
at once.</p >
23
59
<hr />
24
60
<h3 >Types</h3 >
25
61
<h4 ><a name =" pollable " ><code >resource pollable</code ></a ></h4 >
26
- <h2 >A & quot ; pollable& quot ; handle .</h2 >
62
+ <h2 >< a href = " # pollable" >< code >pollable</ code ></ a > epresents a single I/O event which may be ready, or not .</h2 >
27
63
<h3 >Functions</h3 >
28
- <h4 ><a name =" poll_list " ><code >poll-list: func</code ></a ></h4 >
64
+ <h4 ><a name =" method_pollable.ready " ><code >[method]pollable.ready: func</code ></a ></h4 >
65
+ <p >Return the readiness of a pollable. This function never blocks.</p >
66
+ <p >Returns <code >true</code > when the pollable is ready, and <code >false</code > otherwise.</p >
67
+ <h5 >Params</h5 >
68
+ <ul >
69
+ <li ><a name =" method_pollable.ready.self " ><code >self</code ></a >: borrow< ; <a href =" #pollable " ><a href =" #pollable " ><code >pollable</code ></a ></a >> ; </li >
70
+ </ul >
71
+ <h5 >Return values</h5 >
72
+ <ul >
73
+ <li ><a name =" method_pollable.ready.0 " ></a > <code >bool</code ></li >
74
+ </ul >
75
+ <h4 ><a name =" method_pollable.block " ><code >[method]pollable.block: func</code ></a ></h4 >
76
+ <p ><code >block</code > returns immediately if the pollable is ready, and otherwise
77
+ blocks until ready.</p >
78
+ <p >This function is equivalent to calling <code >poll.poll</code > on a list
79
+ containing only this pollable.</p >
80
+ <h5 >Params</h5 >
81
+ <ul >
82
+ <li ><a name =" method_pollable.block.self " ><code >self</code ></a >: borrow< ; <a href =" #pollable " ><a href =" #pollable " ><code >pollable</code ></a ></a >> ; </li >
83
+ </ul >
84
+ <h4 ><a name =" poll " ><code >poll: func</code ></a ></h4 >
29
85
<p >Poll for completion on a set of pollables.</p >
30
86
<p >This function takes a list of pollables, which identify I/O sources of
31
87
interest, and waits until one or more of the events is ready for I/O.</p >
@@ -41,40 +97,26 @@ the pollables has an error, it is indicated by marking the source as
41
97
being reaedy for I/O.</p >
42
98
<h5 >Params</h5 >
43
99
<ul >
44
- <li ><a name =" poll_list .in" ><code >in</code ></a >: list< ; borrow< ; <a href =" #pollable " ><a href =" #pollable " ><code >pollable</code ></a ></a >> ;> ; </li >
100
+ <li ><a name =" poll .in" ><code >in</code ></a >: list< ; borrow< ; <a href =" #pollable " ><a href =" #pollable " ><code >pollable</code ></a ></a >> ;> ; </li >
45
101
</ul >
46
102
<h5 >Return values</h5 >
47
103
<ul >
48
- <li ><a name =" poll_list .0" ></a > list< ; <code >u32</code >> ; </li >
104
+ <li ><a name =" poll .0" ></a > list< ; <code >u32</code >> ; </li >
49
105
</ul >
50
- <h4 ><a name =" poll_one " ><code >poll-one: func</code ></a ></h4 >
51
- <p >Poll for completion on a single pollable.</p >
52
- <p >This function is similar to <a href =" #poll_list " ><code >poll-list</code ></a >, but operates on only a single
53
- pollable. When it returns, the handle is ready for I/O.</p >
54
- <h5 >Params</h5 >
55
- <ul >
56
- <li ><a name =" poll_one.in " ><code >in</code ></a >: borrow< ; <a href =" #pollable " ><a href =" #pollable " ><code >pollable</code ></a ></a >> ; </li >
57
- </ul >
58
- <h2 ><a name =" wasi:io_streams " >Import interface wasi:io/streams</a ></h2 >
106
+ <
h2 ><
a name =
" wasi:io_streams_0.2.0_rc_2023_11_10 " >Import interface wasi:io/
[email protected] </
a ></
h2 >
59
107
<p >WASI I/O is an I/O abstraction API which is currently focused on providing
60
108
stream types.</p >
61
109
<p >In the future, the component model is expected to add built-in stream types;
62
110
when it does, they are expected to subsume this API.</p >
63
111
<hr />
64
112
<h3 >Types</h3 >
65
- <h4 ><a name =" pollable " ><code >type pollable </code ></a ></h4 >
66
- <p ><a href =" #pollable " ><a href =" #pollable " ><code >pollable </code ></a ></a ></p >
113
+ <h4 ><a name =" error " ><code >type error </code ></a ></h4 >
114
+ <p ><a href =" #error " ><a href =" #error " ><code >error </code ></a ></a ></p >
67
115
<p >
68
- #### <a name =" error " >` resource error ` </a >
69
- <p >Contextual error information about the last failure that happened on
70
- a read, write, or flush from an <a href =" #input_stream " ><code >input-stream</code ></a > or <a href =" #output_stream " ><code >output-stream</code ></a >.</p >
71
- <p >This type is returned through the <a href =" #stream_error " ><code >stream-error</code ></a > type whenever an
72
- operation on a stream directly fails or an error is discovered
73
- after-the-fact, for example when a write's failure shows up through a
74
- later <code >flush</code > or <code >check-write</code >.</p >
75
- <p >Interfaces such as <code >wasi:filesystem/types</code > provide functionality to
76
- further " ; downcast" ; this error into interface-specific error information.</p >
77
- <h4 ><a name =" stream_error " ><code >variant stream-error</code ></a ></h4 >
116
+ #### <a name =" pollable " >` type pollable ` </a >
117
+ [ ` pollable ` ] ( #pollable )
118
+ <p >
119
+ #### <a name =" stream_error " >` variant stream-error ` </a >
78
120
<p >An error for input-stream and output-stream operations.</p >
79
121
<h5 >Variant Cases</h5 >
80
122
<ul >
@@ -97,30 +139,16 @@ platforms. I/O operations always return promptly; if fewer bytes are
97
139
promptly available than requested, they return the number of bytes promptly
98
140
available, which could even be zero. To wait for data to be available,
99
141
use the <code >subscribe</code > function to obtain a <a href =" #pollable " ><code >pollable</code ></a > which can be polled
100
- for using <a href = " #wasi:io_poll " >< code >wasi: io /poll</code ></ a >.</p >
142
+ for using <code >wasi: io /poll</code >.</p >
101
143
<h4 ><a name =" output_stream " ><code >resource output-stream</code ></a ></h4 >
102
144
<p >An output bytestream.</p >
103
145
<h2 ><a href =" #output_stream " ><code >output-stream</code ></a >s are <em >non-blocking</em > to the extent practical on
104
146
underlying platforms. Except where specified otherwise, I/O operations also
105
147
always return promptly, after the number of bytes that can be written
106
148
promptly, which could even be zero. To wait for the stream to be ready to
107
149
accept data, the <code >subscribe</code > function to obtain a <a href =" #pollable " ><code >pollable</code ></a > which can be
108
- polled for using <a href = " #wasi:io_poll " >< code >wasi: io /poll</code ></ a >.</h2 >
150
+ polled for using <code >wasi: io /poll</code >.</h2 >
109
151
<h3 >Functions</h3 >
110
- <h4 ><a name =" method_error.to_debug_string " ><code >[method]error.to-debug-string: func</code ></a ></h4 >
111
- <p >Returns a string that's suitable to assist humans in debugging this
112
- error.</p >
113
- <p >The returned string will change across platforms and hosts which
114
- means that parsing it, for example, would be a
115
- platform-compatibility hazard.</p >
116
- <h5 >Params</h5 >
117
- <ul >
118
- <li ><a name =" method_error.to_debug_string.self " ><code >self</code ></a >: borrow< ; <a href =" #error " ><a href =" #error " ><code >error</code ></a ></a >> ; </li >
119
- </ul >
120
- <h5 >Return values</h5 >
121
- <ul >
122
- <li ><a name =" method_error.to_debug_string.0 " ></a > <code >string</code ></li >
123
- </ul >
124
152
<h4 ><a name =" method_input_stream.read " ><code >[method]input-stream.read: func</code ></a ></h4 >
125
153
<p >Perform a non-blocking read from the stream.</p >
126
154
<p >This function returns a list of bytes containing the read data,
0 commit comments