22<ul >
33<li >Imports:
44<ul >
5- <
li >interface <
a href =
" #wasi_sockets_network_0_2_0 " ><
code >wasi:sockets/
[email protected] .
0 </
code ></
a ></
li >
6- <
li >interface <
a href =
" #wasi_sockets_instance_network_0_2_0 " ><
code >wasi:sockets/
[email protected] .
0 </
code ></
a ></
li >
7- <
li >interface <
a href =
" #wasi_io_poll_0_2_0 " ><
code >wasi:io/
[email protected] .
0 </
code ></
a ></
li >
8- <
li >interface <
a href =
" #wasi_sockets_udp_0_2_0 " ><
code >wasi:sockets/
[email protected] .
0 </
code ></
a ></
li >
9- <
li >interface <
a href =
" #wasi_sockets_udp_create_socket_0_2_0 " ><
code >wasi:sockets/
[email protected] .
0 </
code ></
a ></
li >
10- <
li >interface <
a href =
" #wasi_io_error_0_2_0 " ><
code >wasi:io/
[email protected] .
0 </
code ></
a ></
li >
11- <
li >interface <
a href =
" #wasi_io_streams_0_2_0 " ><
code >wasi:io/
[email protected] .
0 </
code ></
a ></
li >
12- <
li >interface <
a href =
" #wasi_clocks_monotonic_clock_0_2_0 " ><
code >wasi:clocks/
[email protected] .
0 </
code ></
a ></
li >
13- <
li >interface <
a href =
" #wasi_sockets_tcp_0_2_0 " ><
code >wasi:sockets/
[email protected] .
0 </
code ></
a ></
li >
14- <
li >interface <
a href =
" #wasi_sockets_tcp_create_socket_0_2_0 " ><
code >wasi:sockets/
[email protected] .
0 </
code ></
a ></
li >
15- <
li >interface <
a href =
" #wasi_sockets_ip_name_lookup_0_2_0 " ><
code >wasi:sockets/
[email protected] .
0 </
code ></
a ></
li >
5+ <
li >interface <
a href =
" #wasi_sockets_network_0_2_1 " ><
code >wasi:sockets/
[email protected] .
1 </
code ></
a ></
li >
6+ <
li >interface <
a href =
" #wasi_sockets_instance_network_0_2_1 " ><
code >wasi:sockets/
[email protected] .
1 </
code ></
a ></
li >
7+ <
li >interface <
a href =
" #wasi_io_poll_0_2_1 " ><
code >wasi:io/
[email protected] .
1 </
code ></
a ></
li >
8+ <
li >interface <
a href =
" #wasi_sockets_udp_0_2_1 " ><
code >wasi:sockets/
[email protected] .
1 </
code ></
a ></
li >
9+ <
li >interface <
a href =
" #wasi_sockets_udp_create_socket_0_2_1 " ><
code >wasi:sockets/
[email protected] .
1 </
code ></
a ></
li >
10+ <
li >interface <
a href =
" #wasi_io_error_0_2_1 " ><
code >wasi:io/
[email protected] .
1 </
code ></
a ></
li >
11+ <
li >interface <
a href =
" #wasi_io_streams_0_2_1 " ><
code >wasi:io/
[email protected] .
1 </
code ></
a ></
li >
12+ <
li >interface <
a href =
" #wasi_clocks_monotonic_clock_0_2_1 " ><
code >wasi:clocks/
[email protected] .
1 </
code ></
a ></
li >
13+ <
li >interface <
a href =
" #wasi_sockets_tcp_0_2_1 " ><
code >wasi:sockets/
[email protected] .
1 </
code ></
a ></
li >
14+ <
li >interface <
a href =
" #wasi_sockets_tcp_create_socket_0_2_1 " ><
code >wasi:sockets/
[email protected] .
1 </
code ></
a ></
li >
15+ <
li >interface <
a href =
" #wasi_sockets_ip_name_lookup_0_2_1 " ><
code >wasi:sockets/
[email protected] .
1 </
code ></
a ></
li >
1616</ul >
1717</li >
1818</ul >
19- <
h2 ><
a name =
" wasi_sockets_network_0_2_0 " ></
a >Import interface wasi:sockets/
[email protected] .
0 </
h2 >
19+ <
h2 ><
a name =
" wasi_sockets_network_0_2_1 " ></
a >Import interface wasi:sockets/
[email protected] .
1 </
h2 >
2020<hr />
2121<h3 >Types</h3 >
2222<h4 ><a name =" network " ></a ><code >resource network</code ></h4 >
@@ -209,7 +209,7 @@ supported size.
209209<li ><a name =" ip_socket_address.ipv4 " ></a ><code >ipv4</code >: <a href =" #ipv4_socket_address " ><a href =" #ipv4_socket_address " ><code >ipv4-socket-address</code ></a ></a ></li >
210210<li ><a name =" ip_socket_address.ipv6 " ></a ><code >ipv6</code >: <a href =" #ipv6_socket_address " ><a href =" #ipv6_socket_address " ><code >ipv6-socket-address</code ></a ></a ></li >
211211</ul >
212- <
h2 ><
a name =
" wasi_sockets_instance_network_0_2_0 " ></
a >Import interface wasi:sockets/
[email protected] .
0 </
h2 >
212+ <
h2 ><
a name =
" wasi_sockets_instance_network_0_2_1 " ></
a >Import interface wasi:sockets/
[email protected] .
1 </
h2 >
213213<p >This interface provides a value-export of the default network handle..</p >
214214<hr />
215215<h3 >Types</h3 >
@@ -224,7 +224,7 @@ supported size.
224224<ul >
225225<li ><a name =" instance_network.0 " ></a > own< ; <a href =" #network " ><a href =" #network " ><code >network</code ></a ></a >> ; </li >
226226</ul >
227- <
h2 ><
a name =
" wasi_io_poll_0_2_0 " ></
a >Import interface wasi:io/
[email protected] .
0 </
h2 >
227+ <
h2 ><
a name =
" wasi_io_poll_0_2_1 " ></
a >Import interface wasi:io/
[email protected] .
1 </
h2 >
228228<p >A poll API intended to let users wait for I/O events on multiple handles
229229at once.</p >
230230<hr />
@@ -258,14 +258,17 @@ containing only this pollable.</p>
258258interest, and waits until one or more of the events is ready for I/O.</p >
259259<p >The result <code >list< ; u32> ; </code > contains one or more indices of handles in the
260260argument list that is ready for I/O.</p >
261- <p >If the list contains more elements than can be indexed with a <code >u32</code >
262- value, this function traps.</p >
261+ <p >This function traps if either:</p >
262+ <ul >
263+ <li >the list is empty, or:</li >
264+ <li >the list contains more elements than can be indexed with a <code >u32</code > value.</li >
265+ </ul >
263266<p >A timeout can be implemented by adding a pollable from the
264267wasi-clocks API to the list.</p >
265268<p >This function does not return a <code >result</code >; polling in itself does not
266269do any I/O so it doesn't fail. If any of the I/O sources identified by
267270the pollables has an error, it is indicated by marking the source as
268- being reaedy for I/O.</p >
271+ being ready for I/O.</p >
269272<h5 >Params</h5 >
270273<ul >
271274<li ><a name =" poll.in " ></a ><code >in</code >: list< ; borrow< ; <a href =" #pollable " ><a href =" #pollable " ><code >pollable</code ></a ></a >> ;> ; </li >
@@ -274,7 +277,7 @@ being reaedy for I/O.</p>
274277<ul >
275278<li ><a name =" poll.0 " ></a > list< ; <code >u32</code >> ; </li >
276279</ul >
277- <
h2 ><
a name =
" wasi_sockets_udp_0_2_0 " ></
a >Import interface wasi:sockets/
[email protected] .
0 </
h2 >
280+ <
h2 ><
a name =
" wasi_sockets_udp_0_2_1 " ></
a >Import interface wasi:sockets/
[email protected] .
1 </
h2 >
278281<hr />
279282<h3 >Types</h3 >
280283<h4 ><a name =" pollable " ></a ><code >type pollable</code ></h4 >
@@ -688,7 +691,7 @@ It's planned to be removed when <code>future</code> is natively supported in Pre
688691<ul >
689692<li ><a name =" method_outgoing_datagram_stream_subscribe.0 " ></a > own< ; <a href =" #pollable " ><a href =" #pollable " ><code >pollable</code ></a ></a >> ; </li >
690693</ul >
691- <
h2 ><
a name =
" wasi_sockets_udp_create_socket_0_2_0 " ></
a >Import interface wasi:sockets/
[email protected] .
0 </
h2 >
694+ <
h2 ><
a name =
" wasi_sockets_udp_create_socket_0_2_1 " ></
a >Import interface wasi:sockets/
[email protected] .
1 </
h2 >
692695<hr />
693696<h3 >Types</h3 >
694697<h4 ><a name =" network " ></a ><code >type network</code ></h4 >
@@ -733,7 +736,7 @@ the socket is effectively an in-memory configuration object, unable to communica
733736<ul >
734737<li ><a name =" create_udp_socket.0 " ></a > result< ; own< ; <a href =" #udp_socket " ><a href =" #udp_socket " ><code >udp-socket</code ></a ></a >> ; , <a href =" #error_code " ><a href =" #error_code " ><code >error-code</code ></a ></a >> ; </li >
735738</ul >
736- <
h2 ><
a name =
" wasi_io_error_0_2_0 " ></
a >Import interface wasi:io/
[email protected] .
0 </
h2 >
739+ <
h2 ><
a name =
" wasi_io_error_0_2_1 " ></
a >Import interface wasi:io/
[email protected] .
1 </
h2 >
737740<hr />
738741<h3 >Types</h3 >
739742<h4 ><a name =" error " ></a ><code >resource error</code ></h4 >
@@ -743,13 +746,11 @@ which provides some human-readable information about the error.</p>
743746<p >In the <code >wasi:io</code > package, this resource is returned through the
744747<code >wasi: io /streams/stream-error</code > type.</p >
745748<p >To provide more specific error information, other interfaces may
746- provide functions to further " ; downcast" ; this error into more specific
747- error information. For example, <a href =" #error " ><code >error</code ></a >s returned in streams derived
748- from filesystem types to be described using the filesystem's own
749- error-code type, using the function
750- <code >wasi: filesystem /types/filesystem-error-code</code >, which takes a parameter
751- <code >borrow< ; error> ; </code > and returns
752- <code >option< ; wasi: filesystem /types/error-code> ; </code >.</p >
749+ offer functions to " ; downcast" ; this error into more specific types. For example,
750+ errors returned from streams derived from filesystem types can be described using
751+ the filesystem's own error-code type. This is done using the function
752+ <code >wasi: filesystem /types/filesystem-error-code</code >, which takes a <code >borrow< ; error> ; </code >
753+ parameter and returns an <code >option< ; wasi: filesystem /types/error-code> ; </code >.</p >
753754<h2 >The set of functions which can " ; downcast" ; an <a href =" #error " ><code >error</code ></a > into a more
754755concrete type is open.</h2 >
755756<h3 >Functions</h3 >
@@ -768,7 +769,7 @@ hazard.</p>
768769<ul >
769770<li ><a name =" method_error_to_debug_string.0 " ></a > <code >string</code ></li >
770771</ul >
771- <
h2 ><
a name =
" wasi_io_streams_0_2_0 " ></
a >Import interface wasi:io/
[email protected] .
0 </
h2 >
772+ <
h2 ><
a name =
" wasi_io_streams_0_2_1 " ></
a >Import interface wasi:io/
[email protected] .
1 </
h2 >
772773<p >WASI I/O is an I/O abstraction API which is currently focused on providing
773774stream types.</p >
774775<p >In the future, the component model is expected to add built-in stream types;
@@ -807,12 +808,15 @@ use the <code>subscribe</code> function to obtain a <a href="#pollable"><code>po
807808for using <code >wasi: io /poll</code >.</p >
808809<h4 ><a name =" output_stream " ></a ><code >resource output-stream</code ></h4 >
809810<p >An output bytestream.</p >
810- <h2 ><a href =" #output_stream " ><code >output-stream</code ></a >s are <em >non-blocking</em > to the extent practical on
811+ <p ><a href =" #output_stream " ><code >output-stream</code ></a >s are <em >non-blocking</em > to the extent practical on
811812underlying platforms. Except where specified otherwise, I/O operations also
812813always return promptly, after the number of bytes that can be written
813814promptly, which could even be zero. To wait for the stream to be ready to
814815accept data, the <code >subscribe</code > function to obtain a <a href =" #pollable " ><code >pollable</code ></a > which can be
815- polled for using <code >wasi: io /poll</code >.</h2 >
816+ polled for using <code >wasi: io /poll</code >.</p >
817+ <h2 >Dropping an <a href =" #output_stream " ><code >output-stream</code ></a > while there's still an active write in
818+ progress may result in the data being lost. Before dropping the stream,
819+ be sure to fully flush your writes.</h2 >
816820<h3 >Functions</h3 >
817821<h4 ><a name =" method_input_stream_read " ></a ><code >[method]input-stream.read: func</code ></h4 >
818822<p >Perform a non-blocking read from the stream.</p >
@@ -994,7 +998,7 @@ and stream is ready for writing again.</p>
994998</ul >
995999<h4 ><a name =" method_output_stream_subscribe " ></a ><code >[method]output-stream.subscribe: func</code ></h4 >
9961000<p >Create a <a href =" #pollable " ><code >pollable</code ></a > which will resolve once the output-stream
997- is ready for more writing, or an error has occured . When this
1001+ is ready for more writing, or an error has occurred . When this
9981002pollable is ready, <code >check-write</code > will return <code >ok(n)</code > with n> ; 0, or an
9991003error.</p >
10001004<p >If the stream is closed, this pollable is always ready immediately.</p >
@@ -1057,7 +1061,7 @@ let _ = this.check-write(); // eliding error handling
10571061</ul >
10581062<h4 ><a name =" method_output_stream_splice " ></a ><code >[method]output-stream.splice: func</code ></h4 >
10591063<p >Read from one stream and write to another.</p >
1060- <p >The behavior of splice is equivelant to:</p >
1064+ <p >The behavior of splice is equivalent to:</p >
10611065<ol >
10621066<li >calling <code >check-write</code > on the <a href =" #output_stream " ><code >output-stream</code ></a ></li >
10631067<li >calling <code >read</code > on the <a href =" #input_stream " ><code >input-stream</code ></a > with the smaller of the
@@ -1093,14 +1097,13 @@ is ready for reading, before performing the <code>splice</code>.</p>
10931097<ul >
10941098<li ><a name =" method_output_stream_blocking_splice.0 " ></a > result< ; <code >u64</code >, <a href =" #stream_error " ><a href =" #stream_error " ><code >stream-error</code ></a ></a >> ; </li >
10951099</ul >
1096- <
h2 ><
a name =
" wasi_clocks_monotonic_clock_0_2_0 " ></
a >Import interface wasi:clocks/
[email protected] .
0 </
h2 >
1100+ <
h2 ><
a name =
" wasi_clocks_monotonic_clock_0_2_1 " ></
a >Import interface wasi:clocks/
[email protected] .
1 </
h2 >
10971101<p >WASI Monotonic Clock is a clock API intended to let users measure elapsed
10981102time.</p >
10991103<p >It is intended to be portable at least between Unix-family platforms and
11001104Windows.</p >
11011105<p >A monotonic clock is a clock which has an unspecified initial value, and
11021106successive reads of the clock will produce non-decreasing values.</p >
1103- <p >It is intended for measuring elapsed time.</p >
11041107<hr />
11051108<h3 >Types</h3 >
11061109<h4 ><a name =" pollable " ></a ><code >type pollable</code ></h4 >
@@ -1133,7 +1136,7 @@ corresponding to a clock tick.</p>
11331136</ul >
11341137<h4 ><a name =" subscribe_instant " ></a ><code >subscribe-instant: func</code ></h4 >
11351138<p >Create a <a href =" #pollable " ><code >pollable</code ></a > which will resolve once the specified instant
1136- occured .</p >
1139+ has occurred .</p >
11371140<h5 >Params</h5 >
11381141<ul >
11391142<li ><a name =" subscribe_instant.when " ></a ><code >when</code >: <a href =" #instant " ><a href =" #instant " ><code >instant</code ></a ></a ></li >
@@ -1143,9 +1146,8 @@ occured.</p>
11431146<li ><a name =" subscribe_instant.0 " ></a > own< ; <a href =" #pollable " ><a href =" #pollable " ><code >pollable</code ></a ></a >> ; </li >
11441147</ul >
11451148<h4 ><a name =" subscribe_duration " ></a ><code >subscribe-duration: func</code ></h4 >
1146- <p >Create a <a href =" #pollable " ><code >pollable</code ></a > which will resolve once the given duration has
1147- elapsed, starting at the time at which this function was called.
1148- occured.</p >
1149+ <p >Create a <a href =" #pollable " ><code >pollable</code ></a > that will resolve after the specified duration has
1150+ elapsed from the time this function is invoked.</p >
11491151<h5 >Params</h5 >
11501152<ul >
11511153<li ><a name =" subscribe_duration.when " ></a ><code >when</code >: <a href =" #duration " ><a href =" #duration " ><code >duration</code ></a ></a ></li >
@@ -1154,7 +1156,7 @@ occured.</p>
11541156<ul >
11551157<li ><a name =" subscribe_duration.0 " ></a > own< ; <a href =" #pollable " ><a href =" #pollable " ><code >pollable</code ></a ></a >> ; </li >
11561158</ul >
1157- <
h2 ><
a name =
" wasi_sockets_tcp_0_2_0 " ></
a >Import interface wasi:sockets/
[email protected] .
0 </
h2 >
1159+ <
h2 ><
a name =
" wasi_sockets_tcp_0_2_1 " ></
a >Import interface wasi:sockets/
[email protected] .
1 </
h2 >
11581160<hr />
11591161<h3 >Types</h3 >
11601162<h4 ><a name =" input_stream " ></a ><code >type input-stream</code ></h4 >
@@ -1745,7 +1747,7 @@ has no effect and returns <code>ok</code>.</p>
17451747<ul >
17461748<li ><a name =" method_tcp_socket_shutdown.0 " ></a > result< ; _, <a href =" #error_code " ><a href =" #error_code " ><code >error-code</code ></a ></a >> ; </li >
17471749</ul >
1748- <
h2 ><
a name =
" wasi_sockets_tcp_create_socket_0_2_0 " ></
a >Import interface wasi:sockets/
[email protected] .
0 </
h2 >
1750+ <
h2 ><
a name =
" wasi_sockets_tcp_create_socket_0_2_1 " ></
a >Import interface wasi:sockets/
[email protected] .
1 </
h2 >
17491751<hr />
17501752<h3 >Types</h3 >
17511753<h4 ><a name =" network " ></a ><code >type network</code ></h4 >
@@ -1790,7 +1792,7 @@ is called, the socket is effectively an in-memory configuration object, unable t
17901792<ul >
17911793<li ><a name =" create_tcp_socket.0 " ></a > result< ; own< ; <a href =" #tcp_socket " ><a href =" #tcp_socket " ><code >tcp-socket</code ></a ></a >> ; , <a href =" #error_code " ><a href =" #error_code " ><code >error-code</code ></a ></a >> ; </li >
17921794</ul >
1793- <
h2 ><
a name =
" wasi_sockets_ip_name_lookup_0_2_0 " ></
a >Import interface wasi:sockets/
[email protected] .
0 </
h2 >
1795+ <
h2 ><
a name =
" wasi_sockets_ip_name_lookup_0_2_1 " ></
a >Import interface wasi:sockets/
[email protected] .
1 </
h2 >
17941796<hr />
17951797<h3 >Types</h3 >
17961798<h4 ><a name =" pollable " ></a ><code >type pollable</code ></h4 >
0 commit comments