Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.2.3 #110

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 77 additions & 55 deletions imports.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,60 @@
<ul>
<li>Imports:
<ul>
<li>interface <a href="#wasi_sockets_network_0_2_2"><code>wasi:sockets/network@0.2.2</code></a></li>
<li>interface <a href="#wasi_sockets_instance_network_0_2_2"><code>wasi:sockets/instance-[email protected].2</code></a></li>
<li>interface <a href="#wasi_io_poll_0_2_2"><code>wasi:io/poll@0.2.2</code></a></li>
<li>interface <a href="#wasi_sockets_udp_0_2_2"><code>wasi:sockets/udp@0.2.2</code></a></li>
<li>interface <a href="#wasi_sockets_udp_create_socket_0_2_2"><code>wasi:sockets/udp-create-socket@0.2.2</code></a></li>
<li>interface <a href="#wasi_io_error_0_2_2"><code>wasi:io/error@0.2.2</code></a></li>
<li>interface <a href="#wasi_io_streams_0_2_2"><code>wasi:io/[email protected].2</code></a></li>
<li>interface <a href="#wasi_clocks_monotonic_clock_0_2_2"><code>wasi:clocks/[email protected].2</code></a></li>
<li>interface <a href="#wasi_sockets_tcp_0_2_2"><code>wasi:sockets/[email protected].2</code></a></li>
<li>interface <a href="#wasi_sockets_tcp_create_socket_0_2_2"><code>wasi:sockets/[email protected].2</code></a></li>
<li>interface <a href="#wasi_sockets_ip_name_lookup_0_2_2"><code>wasi:sockets/[email protected].2</code></a></li>
<li>interface <a href="#wasi_io_error_0_2_3"><code>wasi:io/error@0.2.3</code></a></li>
<li>interface <a href="#wasi_sockets_network_0_2_3"><code>wasi:sockets/[email protected].3</code></a></li>
<li>interface <a href="#wasi_sockets_instance_network_0_2_3"><code>wasi:sockets/instance-network@0.2.3</code></a></li>
<li>interface <a href="#wasi_io_poll_0_2_3"><code>wasi:io/poll@0.2.3</code></a></li>
<li>interface <a href="#wasi_sockets_udp_0_2_3"><code>wasi:sockets/[email protected].3</code></a></li>
<li>interface <a href="#wasi_sockets_udp_create_socket_0_2_3"><code>wasi:sockets/udp-create-socket@0.2.3</code></a></li>
<li>interface <a href="#wasi_io_streams_0_2_3"><code>wasi:io/[email protected].3</code></a></li>
<li>interface <a href="#wasi_clocks_monotonic_clock_0_2_3"><code>wasi:clocks/[email protected].3</code></a></li>
<li>interface <a href="#wasi_sockets_tcp_0_2_3"><code>wasi:sockets/[email protected].3</code></a></li>
<li>interface <a href="#wasi_sockets_tcp_create_socket_0_2_3"><code>wasi:sockets/[email protected].3</code></a></li>
<li>interface <a href="#wasi_sockets_ip_name_lookup_0_2_3"><code>wasi:sockets/[email protected].3</code></a></li>
</ul>
</li>
</ul>
<h2><a id="wasi_sockets_network_0_2_2"></a>Import interface wasi:sockets/network@0.2.2</h2>
<h2><a id="wasi_io_error_0_2_3"></a>Import interface wasi:io/error@0.2.3</h2>
<hr />
<h3>Types</h3>
<h4><a id="network"></a><code>resource network</code></h4>
<h4><a id="error"></a><code>resource error</code></h4>
<p>A resource which represents some error information.</p>
<p>The only method provided by this resource is <code>to-debug-string</code>,
which provides some human-readable information about the error.</p>
<p>In the <code>wasi:io</code> package, this resource is returned through the
<code>wasi:io/streams/stream-error</code> type.</p>
<p>To provide more specific error information, other interfaces may
offer functions to &quot;downcast&quot; this error into more specific types. For example,
errors returned from streams derived from filesystem types can be described using
the filesystem's own error-code type. This is done using the function
<code>wasi:filesystem/types/filesystem-error-code</code>, which takes a <code>borrow&lt;error&gt;</code>
parameter and returns an <code>option&lt;wasi:filesystem/types/error-code&gt;</code>.</p>
<h2>The set of functions which can &quot;downcast&quot; an <a href="#error"><code>error</code></a> into a more
concrete type is open.</h2>
<h3>Functions</h3>
<h4><a id="method_error_to_debug_string"></a><code>[method]error.to-debug-string: func</code></h4>
<p>Returns a string that is suitable to assist humans in debugging
this error.</p>
<p>WARNING: The returned string should not be consumed mechanically!
It may change across platforms, hosts, or other implementation
details. Parsing this string is a major platform-compatibility
hazard.</p>
<h5>Params</h5>
<ul>
<li><a id="method_error_to_debug_string.self"></a><code>self</code>: borrow&lt;<a href="#error"><a href="#error"><code>error</code></a></a>&gt;</li>
</ul>
<h5>Return values</h5>
<ul>
<li><a id="method_error_to_debug_string.0"></a> <code>string</code></li>
</ul>
<h2><a id="wasi_sockets_network_0_2_3"></a>Import interface wasi:sockets/[email protected]</h2>
<hr />
<h3>Types</h3>
<h4><a id="error"></a><code>type error</code></h4>
<p><a href="#error"><a href="#error"><code>error</code></a></a></p>
<p>
#### <a id="network"></a>`resource network`
<p>An opaque resource that represents access to (a subset of) the network.
This enables context-based security for networking.
There is no need for this to map 1:1 to a physical network interface.</p>
Expand Down Expand Up @@ -209,7 +245,26 @@ supported size.
<li><a id="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>
<li><a id="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>
</ul>
<h2><a id="wasi_sockets_instance_network_0_2_2"></a>Import interface wasi:sockets/[email protected]</h2>
<hr />
<h3>Functions</h3>
<h4><a id="network_error_code"></a><code>network-error-code: func</code></h4>
<p>Attempts to extract a network-related <a href="#error_code"><code>error-code</code></a> from the stream
<a href="#error"><code>error</code></a> provided.</p>
<p>Stream operations which return <a href="#stream_error.last_operation_failed"><code>stream-error::last-operation-failed</code></a>
have a payload with more information about the operation that failed.
This payload can be passed through to this function to see if there's
network-related information about the error to return.</p>
<p>Note that this function is fallible because not all stream-related
errors are network-related errors.</p>
<h5>Params</h5>
<ul>
<li><a id="network_error_code.err"></a><code>err</code>: borrow&lt;<a href="#error"><a href="#error"><code>error</code></a></a>&gt;</li>
</ul>
<h5>Return values</h5>
<ul>
<li><a id="network_error_code.0"></a> option&lt;<a href="#error_code"><a href="#error_code"><code>error-code</code></a></a>&gt;</li>
</ul>
<h2><a id="wasi_sockets_instance_network_0_2_3"></a>Import interface wasi:sockets/[email protected]</h2>
<p>This interface provides a value-export of the default network handle..</p>
<hr />
<h3>Types</h3>
Expand All @@ -224,7 +279,7 @@ supported size.
<ul>
<li><a id="instance_network.0"></a> own&lt;<a href="#network"><a href="#network"><code>network</code></a></a>&gt;</li>
</ul>
<h2><a id="wasi_io_poll_0_2_2"></a>Import interface wasi:io/[email protected].2</h2>
<h2><a id="wasi_io_poll_0_2_3"></a>Import interface wasi:io/[email protected].3</h2>
<p>A poll API intended to let users wait for I/O events on multiple handles
at once.</p>
<hr />
Expand Down Expand Up @@ -277,7 +332,7 @@ being ready for I/O.</p>
<ul>
<li><a id="poll.0"></a> list&lt;<code>u32</code>&gt;</li>
</ul>
<h2><a id="wasi_sockets_udp_0_2_2"></a>Import interface wasi:sockets/[email protected].2</h2>
<h2><a id="wasi_sockets_udp_0_2_3"></a>Import interface wasi:sockets/[email protected].3</h2>
<hr />
<h3>Types</h3>
<h4><a id="pollable"></a><code>type pollable</code></h4>
Expand Down Expand Up @@ -691,7 +746,7 @@ It's planned to be removed when <code>future</code> is natively supported in Pre
<ul>
<li><a id="method_outgoing_datagram_stream_subscribe.0"></a> own&lt;<a href="#pollable"><a href="#pollable"><code>pollable</code></a></a>&gt;</li>
</ul>
<h2><a id="wasi_sockets_udp_create_socket_0_2_2"></a>Import interface wasi:sockets/[email protected].2</h2>
<h2><a id="wasi_sockets_udp_create_socket_0_2_3"></a>Import interface wasi:sockets/[email protected].3</h2>
<hr />
<h3>Types</h3>
<h4><a id="network"></a><code>type network</code></h4>
Expand Down Expand Up @@ -736,40 +791,7 @@ the socket is effectively an in-memory configuration object, unable to communica
<ul>
<li><a id="create_udp_socket.0"></a> result&lt;own&lt;<a href="#udp_socket"><a href="#udp_socket"><code>udp-socket</code></a></a>&gt;, <a href="#error_code"><a href="#error_code"><code>error-code</code></a></a>&gt;</li>
</ul>
<h2><a id="wasi_io_error_0_2_2"></a>Import interface wasi:io/[email protected]</h2>
<hr />
<h3>Types</h3>
<h4><a id="error"></a><code>resource error</code></h4>
<p>A resource which represents some error information.</p>
<p>The only method provided by this resource is <code>to-debug-string</code>,
which provides some human-readable information about the error.</p>
<p>In the <code>wasi:io</code> package, this resource is returned through the
<code>wasi:io/streams/stream-error</code> type.</p>
<p>To provide more specific error information, other interfaces may
offer functions to &quot;downcast&quot; this error into more specific types. For example,
errors returned from streams derived from filesystem types can be described using
the filesystem's own error-code type. This is done using the function
<code>wasi:filesystem/types/filesystem-error-code</code>, which takes a <code>borrow&lt;error&gt;</code>
parameter and returns an <code>option&lt;wasi:filesystem/types/error-code&gt;</code>.</p>
<h2>The set of functions which can &quot;downcast&quot; an <a href="#error"><code>error</code></a> into a more
concrete type is open.</h2>
<h3>Functions</h3>
<h4><a id="method_error_to_debug_string"></a><code>[method]error.to-debug-string: func</code></h4>
<p>Returns a string that is suitable to assist humans in debugging
this error.</p>
<p>WARNING: The returned string should not be consumed mechanically!
It may change across platforms, hosts, or other implementation
details. Parsing this string is a major platform-compatibility
hazard.</p>
<h5>Params</h5>
<ul>
<li><a id="method_error_to_debug_string.self"></a><code>self</code>: borrow&lt;<a href="#error"><a href="#error"><code>error</code></a></a>&gt;</li>
</ul>
<h5>Return values</h5>
<ul>
<li><a id="method_error_to_debug_string.0"></a> <code>string</code></li>
</ul>
<h2><a id="wasi_io_streams_0_2_2"></a>Import interface wasi:io/[email protected]</h2>
<h2><a id="wasi_io_streams_0_2_3"></a>Import interface wasi:io/[email protected]</h2>
<p>WASI I/O is an I/O abstraction API which is currently focused on providing
stream types.</p>
<p>In the future, the component model is expected to add built-in stream types;
Expand Down Expand Up @@ -1099,7 +1121,7 @@ is ready for reading, before performing the <code>splice</code>.</p>
<ul>
<li><a id="method_output_stream_blocking_splice.0"></a> result&lt;<code>u64</code>, <a href="#stream_error"><a href="#stream_error"><code>stream-error</code></a></a>&gt;</li>
</ul>
<h2><a id="wasi_clocks_monotonic_clock_0_2_2"></a>Import interface wasi:clocks/[email protected].2</h2>
<h2><a id="wasi_clocks_monotonic_clock_0_2_3"></a>Import interface wasi:clocks/[email protected].3</h2>
<p>WASI Monotonic Clock is a clock API intended to let users measure elapsed
time.</p>
<p>It is intended to be portable at least between Unix-family platforms and
Expand Down Expand Up @@ -1158,7 +1180,7 @@ elapsed from the time this function is invoked.</p>
<ul>
<li><a id="subscribe_duration.0"></a> own&lt;<a href="#pollable"><a href="#pollable"><code>pollable</code></a></a>&gt;</li>
</ul>
<h2><a id="wasi_sockets_tcp_0_2_2"></a>Import interface wasi:sockets/[email protected].2</h2>
<h2><a id="wasi_sockets_tcp_0_2_3"></a>Import interface wasi:sockets/[email protected].3</h2>
<hr />
<h3>Types</h3>
<h4><a id="input_stream"></a><code>type input-stream</code></h4>
Expand Down Expand Up @@ -1749,7 +1771,7 @@ has no effect and returns <code>ok</code>.</p>
<ul>
<li><a id="method_tcp_socket_shutdown.0"></a> result&lt;_, <a href="#error_code"><a href="#error_code"><code>error-code</code></a></a>&gt;</li>
</ul>
<h2><a id="wasi_sockets_tcp_create_socket_0_2_2"></a>Import interface wasi:sockets/[email protected].2</h2>
<h2><a id="wasi_sockets_tcp_create_socket_0_2_3"></a>Import interface wasi:sockets/[email protected].3</h2>
<hr />
<h3>Types</h3>
<h4><a id="network"></a><code>type network</code></h4>
Expand Down Expand Up @@ -1794,7 +1816,7 @@ is called, the socket is effectively an in-memory configuration object, unable t
<ul>
<li><a id="create_tcp_socket.0"></a> result&lt;own&lt;<a href="#tcp_socket"><a href="#tcp_socket"><code>tcp-socket</code></a></a>&gt;, <a href="#error_code"><a href="#error_code"><code>error-code</code></a></a>&gt;</li>
</ul>
<h2><a id="wasi_sockets_ip_name_lookup_0_2_2"></a>Import interface wasi:sockets/[email protected].2</h2>
<h2><a id="wasi_sockets_ip_name_lookup_0_2_3"></a>Import interface wasi:sockets/[email protected].3</h2>
<hr />
<h3>Types</h3>
<h4><a id="pollable"></a><code>type pollable</code></h4>
Expand Down
8 changes: 4 additions & 4 deletions wit/deps.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[clocks]
url = "https://github.com/WebAssembly/wasi-clocks/archive/main.tar.gz"
sha256 = "c2da62619d1067646316e8592b583d77036d778e28b1154353e0825956b3d6aa"
sha512 = "4d409fc38b31646fc5de70160e81bd3fa67f9c99b4d24543b4fd40a922c7545739869521b8a997efb675d0816de8b001b6af7950e0cb0bc823d89b9f07b286c4"
sha256 = "93a701968a7dd3c5d69031bc0601681c468972fdf7e28a93bb6150a67d6ebe8b"
sha512 = "98fca567c7a01887b0fb38981f1772169b6ea8de475b546508f8b86738d84e44ba95cae81def40ac34e8809f5f60e85224077ab8cb6d6d5d6296acc1df73c159"

[io]
url = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
sha256 = "6d8dbfaaaa685167c1829616dc7265f5f3cb776845879555612d56544f6d9bfc"
sha512 = "52219562c4183503169cd2947b8164e1c96974500a5adf15bbf382c5992a10a626cc89c3b319204aeda6698ce59cbca2c42f98f7fde296aa77b9db4b41154dbe"
sha256 = "1cccbfe4122686ea57a25cd368e8cdfc408cbcad089f47fb6685b6f92e96f050"
sha512 = "7a95f964c13da52611141acd89bc8876226497f128e99dd176a4270c5b5efbd8cc847b5fbd1a91258d028c646db99e0424d72590cf1caf20f9f3a3343fad5017"
4 changes: 2 additions & 2 deletions wit/deps/clocks/monotonic-clock.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:[email protected].2;
package wasi:[email protected].3;
/// WASI Monotonic Clock is a clock API intended to let users measure elapsed
/// time.
///
Expand All @@ -10,7 +10,7 @@ package wasi:[email protected];
@since(version = 0.2.0)
interface monotonic-clock {
@since(version = 0.2.0)
use wasi:io/[email protected].2.{pollable};
use wasi:io/[email protected].3.{pollable};

/// An instant in time, in nanoseconds. An instant is relative to an
/// unspecified initial value, and can only be compared to instances from
Expand Down
2 changes: 1 addition & 1 deletion wit/deps/clocks/timezone.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:[email protected].2;
package wasi:[email protected].3;

@unstable(feature = clocks-timezone)
interface timezone {
Expand Down
2 changes: 1 addition & 1 deletion wit/deps/clocks/wall-clock.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:[email protected].2;
package wasi:[email protected].3;
/// WASI Wall Clock is a clock API intended to let users query the current
/// time. The name "wall" makes an analogy to a "clock on the wall", which
/// is not necessarily monotonic as it may be reset.
Expand Down
2 changes: 1 addition & 1 deletion wit/deps/clocks/world.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:[email protected].2;
package wasi:[email protected].3;

@since(version = 0.2.0)
world imports {
Expand Down
2 changes: 1 addition & 1 deletion wit/deps/io/error.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:[email protected].2;
package wasi:[email protected].3;

@since(version = 0.2.0)
interface error {
Expand Down
2 changes: 1 addition & 1 deletion wit/deps/io/poll.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:[email protected].2;
package wasi:[email protected].3;

/// A poll API intended to let users wait for I/O events on multiple handles
/// at once.
Expand Down
2 changes: 1 addition & 1 deletion wit/deps/io/streams.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:[email protected].2;
package wasi:[email protected].3;

/// WASI I/O is an I/O abstraction API which is currently focused on providing
/// stream types.
Expand Down
2 changes: 1 addition & 1 deletion wit/deps/io/world.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:[email protected].2;
package wasi:[email protected].3;

@since(version = 0.2.0)
world imports {
Expand Down
2 changes: 1 addition & 1 deletion wit/ip-name-lookup.wit
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@since(version = 0.2.0)
interface ip-name-lookup {
@since(version = 0.2.0)
use wasi:io/[email protected].2.{pollable};
use wasi:io/[email protected].3.{pollable};
@since(version = 0.2.0)
use network.{network, error-code, ip-address};

Expand Down
2 changes: 1 addition & 1 deletion wit/network.wit
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@since(version = 0.2.0)
interface network {
@unstable(feature = network-error-code)
use wasi:io/[email protected].2.{error};
use wasi:io/[email protected].3.{error};

/// An opaque resource that represents access to (a subset of) the network.
/// This enables context-based security for networking.
Expand Down
6 changes: 3 additions & 3 deletions wit/tcp.wit
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@since(version = 0.2.0)
interface tcp {
@since(version = 0.2.0)
use wasi:io/[email protected].2.{input-stream, output-stream};
use wasi:io/[email protected].3.{input-stream, output-stream};
@since(version = 0.2.0)
use wasi:io/[email protected].2.{pollable};
use wasi:io/[email protected].3.{pollable};
@since(version = 0.2.0)
use wasi:clocks/[email protected].2.{duration};
use wasi:clocks/[email protected].3.{duration};
@since(version = 0.2.0)
use network.{network, error-code, ip-socket-address, ip-address-family};

Expand Down
2 changes: 1 addition & 1 deletion wit/udp.wit
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@since(version = 0.2.0)
interface udp {
@since(version = 0.2.0)
use wasi:io/[email protected].2.{pollable};
use wasi:io/[email protected].3.{pollable};
@since(version = 0.2.0)
use network.{network, error-code, ip-socket-address, ip-address-family};

Expand Down
2 changes: 1 addition & 1 deletion wit/world.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:[email protected].2;
package wasi:[email protected].3;

@since(version = 0.2.0)
world imports {
Expand Down
Loading