diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 52a7b9e..248ca1d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,6 +18,7 @@ jobs: ./wit-deps lock git add -N wit/deps git diff --exit-code - - 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' + wasm-tools: '1.218.0' diff --git a/imports.md b/imports.md index 737ff7d..f494ad3 100644 --- a/imports.md +++ b/imports.md @@ -1,29 +1,29 @@ -

World imports

+

World imports

-

Import interface wasi:sockets/network@0.2.1

+

Import interface wasi:sockets/network@0.2.2


Types

-

resource network

+

resource network

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.

-

enum error-code

+

enum error-code

Error codes.

In theory, every API can return any error code. In practice, API's typically only return the errors documented per API @@ -39,220 +39,220 @@ combined with a couple of errors that are always possible:

Enum Cases
-

enum ip-address-family

+

enum ip-address-family

Enum Cases
-

tuple ipv4-address

+

tuple ipv4-address

Tuple Fields
-

tuple ipv6-address

+

tuple ipv6-address

Tuple Fields
-

variant ip-address

+

variant ip-address

Variant Cases
-

record ipv4-socket-address

+

record ipv4-socket-address

Record Fields
-

record ipv6-socket-address

+

record ipv6-socket-address

Record Fields
-

variant ip-socket-address

+

variant ip-socket-address

Variant Cases
-

Import interface wasi:sockets/instance-network@0.2.1

+

Import interface wasi:sockets/instance-network@0.2.2

This interface provides a value-export of the default network handle..


Types

-

type network

+

type network

network

----

Functions

-

instance-network: func

+

instance-network: func

Get a handle to the default network.

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.

@@ -271,56 +271,56 @@ the pollables has an error, it is indicated by marking the source as being ready for I/O.

Params
Return values
-

Import interface wasi:sockets/udp@0.2.1

+

Import interface wasi:sockets/udp@0.2.2


Types

-

type pollable

+

type pollable

pollable

-#### `type network` +#### `type network` [`network`](#network)

-#### `type error-code` +#### `type error-code` [`error-code`](#error_code)

-#### `type ip-socket-address` +#### `type ip-socket-address` [`ip-socket-address`](#ip_socket_address)

-#### `type ip-address-family` +#### `type ip-address-family` [`ip-address-family`](#ip_address_family)

-#### `record incoming-datagram` +#### `record incoming-datagram`

A received datagram.

Record Fields
-

record outgoing-datagram

+

record outgoing-datagram

A datagram to be sent out.

Record Fields
Params
Return values
-

[method]udp-socket.finish-bind: func

+

[method]udp-socket.finish-bind: func

Params
Return values
-

[method]udp-socket.stream: func

+

[method]udp-socket.stream: func

Set up inbound & outbound communication channels, optionally to a specific peer.

This function only changes the local socket configuration and does not generate any network traffic. On success, the remote-address of the socket is updated. The local-address may be updated as well, @@ -423,14 +423,14 @@ if (remote_address is Some) {

Params
Return values
-

[method]udp-socket.local-address: func

+

[method]udp-socket.local-address: func

Get the current bound address.

POSIX mentions:

@@ -451,13 +451,13 @@ stored in the object pointed to by address is unspecified.

Params
Return values
-

[method]udp-socket.remote-address: func

+

[method]udp-socket.remote-address: func

Get the address the socket is currently streaming to.

Typical errors

Params
Return values
-

[method]udp-socket.address-family: func

+

[method]udp-socket.address-family: func

Whether this is a IPv4 or IPv6 socket.

Equivalent to the SO_DOMAIN socket option.

Params
Return values
-

[method]udp-socket.unicast-hop-limit: func

+

[method]udp-socket.unicast-hop-limit: func

Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options.

If the provided value is 0, an invalid-argument error is returned.

Typical errors

@@ -498,23 +498,23 @@ stored in the object pointed to by address is unspecified.

Params
Return values
-

[method]udp-socket.set-unicast-hop-limit: func

+

[method]udp-socket.set-unicast-hop-limit: func

Params
Return values
-

[method]udp-socket.receive-buffer-size: func

+

[method]udp-socket.receive-buffer-size: func

The kernel buffer space reserved for sends/receives on this socket.

If the provided value is 0, an invalid-argument error is returned. Any other value will never cause an error, but it might be silently clamped and/or rounded. @@ -526,54 +526,54 @@ I.e. after setting a value, reading the same setting back may return a different

Params
Return values
-

[method]udp-socket.set-receive-buffer-size: func

+

[method]udp-socket.set-receive-buffer-size: func

Params
Return values
-

[method]udp-socket.send-buffer-size: func

+

[method]udp-socket.send-buffer-size: func

Params
Return values
-

[method]udp-socket.set-send-buffer-size: func

+

[method]udp-socket.set-send-buffer-size: func

Params
Return values
-

[method]udp-socket.subscribe: func

+

[method]udp-socket.subscribe: func

Create a pollable which will resolve once the socket is ready for I/O.

Note: this function is here for WASI Preview2 only. It's planned to be removed when future is natively supported in Preview3.

Params
Return values
-

[method]incoming-datagram-stream.receive: func

+

[method]incoming-datagram-stream.receive: func

Receive messages on the socket.

This function attempts to receive up to max-results datagrams on the socket without blocking. The returned list may contain fewer elements than requested, but never more.

@@ -601,26 +601,26 @@ This function never returns error(would-block).
Params
Return values
-

[method]incoming-datagram-stream.subscribe: func

+

[method]incoming-datagram-stream.subscribe: func

Create a pollable which will resolve once the stream is ready to receive again.

Note: this function is here for WASI Preview2 only. It's planned to be removed when future is natively supported in Preview3.

Params
Return values
-

[method]outgoing-datagram-stream.check-send: func

+

[method]outgoing-datagram-stream.check-send: func

Check readiness for sending. This function never blocks.

Returns the number of datagrams permitted for the next call to send, or an error. Calling send with more datagrams than this function has @@ -631,13 +631,13 @@ error.

Never returns would-block.

Params
Return values
-

[method]outgoing-datagram-stream.send: func

+

[method]outgoing-datagram-stream.send: func

Send messages on the socket.

This function attempts to send all provided datagrams on the socket without blocking and returns how many messages were actually sent (or queued for sending). This function never @@ -672,43 +672,43 @@ either check-send was not called or datagrams contains

Params
Return values
-

[method]outgoing-datagram-stream.subscribe: func

+

[method]outgoing-datagram-stream.subscribe: func

Create a pollable which will resolve once the stream is ready to send again.

Note: this function is here for WASI Preview2 only. It's planned to be removed when future is natively supported in Preview3.

Params
Return values
-

Import interface wasi:sockets/udp-create-socket@0.2.1

+

Import interface wasi:sockets/udp-create-socket@0.2.2


Types

-

type network

+

type network

network

-#### `type error-code` +#### `type error-code` [`error-code`](#error_code)

-#### `type ip-address-family` +#### `type ip-address-family` [`ip-address-family`](#ip_address_family)

-#### `type udp-socket` +#### `type udp-socket` [`udp-socket`](#udp_socket)

----

Functions

-

create-udp-socket: func

+

create-udp-socket: func

Create a new UDP socket.

Similar to socket(AF_INET or AF_INET6, SOCK_DGRAM, IPPROTO_UDP) in POSIX. On IPv6 sockets, IPV6_V6ONLY is enabled by default and can't be configured otherwise.

@@ -730,16 +730,16 @@ the socket is effectively an in-memory configuration object, unable to communica
Params
Return values
-

Import interface wasi:io/error@0.2.1

+

Import interface wasi:io/error@0.2.2


Types

-

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.

@@ -754,7 +754,7 @@ parameter and returns an 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! @@ -763,42 +763,44 @@ details. Parsing this string is a major platform-compatibility hazard.

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

error

-#### `type pollable` +#### `type pollable` [`pollable`](#pollable)

-#### `variant stream-error` +#### `variant stream-error`

An error for input-stream and output-stream operations.

Variant Cases
-

resource input-stream

+

resource input-stream

An input bytestream.

input-streams are non-blocking to the extent practical on underlying platforms. I/O operations always return promptly; if fewer bytes are @@ -806,7 +808,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-streams are non-blocking to the extent practical on underlying platforms. Except where specified otherwise, I/O operations also @@ -818,7 +820,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 @@ -842,51 +844,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
Return values
-

[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
Return values
-

[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
Return values
-

[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
Return values
-

[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. @@ -895,13 +897,13 @@ Implementations may trap if the input-streampollables created with this function are dropped.

Params
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 @@ -911,13 +913,13 @@ become ready when this function will report at least 1 byte, or an error.

Params
Return values
-

[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 @@ -930,14 +932,14 @@ length of less than or equal to n. Otherwise, this function will trap.

the last call to check-write provided a permit.

Params
Return values
-

[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, @@ -961,14 +963,14 @@ let _ = this.check-write(); // eliding error handling

Params
Return values
-

[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 @@ -979,24 +981,24 @@ completed. The subscribe pollable will become ready when the flush has completed and the stream can accept more writes.

Params
Return values
-

[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.

Params
Return values
-

[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 @@ -1007,13 +1009,13 @@ Implementations may trap if the output-streampollables created with this function are dropped.

Params
Return values
-

[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 @@ -1021,14 +1023,14 @@ passing a list of bytes, you simply pass the number of zero-bytes that should be written.

Params
Return values
-

[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.

@@ -1052,14 +1054,14 @@ let _ = this.check-write(); // eliding error handling
Params
Return values
-

[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:

    @@ -1074,30 +1076,30 @@ let _ = this.check-write(); // eliding error handling than len.

    Params
    Return values
    -

    [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.

    Params
    Return values
    -

    Import interface wasi:clocks/monotonic-clock@0.2.1

    +

    Import interface wasi:clocks/monotonic-clock@0.2.2

    WASI Monotonic Clock is a clock API intended to let users measure elapsed time.

    It is intended to be portable at least between Unix-family platforms and @@ -1106,100 +1108,100 @@ Windows.

    successive reads of the clock will produce non-decreasing values.


    Types

    -

    type pollable

    +

    type pollable

    pollable

    -#### `type instant` +#### `type instant` `u64`

    An instant in time, in nanoseconds. An instant is relative to an unspecified initial value, and can only be compared to instances from the same monotonic-clock. -

    type duration

    +

    type duration

    u64

    A duration of time, in nanoseconds.


    Functions

    -

    now: func

    +

    now: func

    Read the current value of the clock.

    The clock is monotonic, therefore calling this function repeatedly will produce a sequence of non-decreasing values.

    Return values
    -

    resolution: func

    +

    resolution: func

    Query the resolution of the clock. Returns the duration of time corresponding to a clock tick.

    Return values
    -

    subscribe-instant: func

    +

    subscribe-instant: func

    Create a pollable which will resolve once the specified instant has occurred.

    Params
    Return values
    -

    subscribe-duration: func

    +

    subscribe-duration: func

    Create a pollable that will resolve after the specified duration has elapsed from the time this function is invoked.

    Params
    Return values
    -

    Import interface wasi:sockets/tcp@0.2.1

    +

    Import interface wasi:sockets/tcp@0.2.2


    Types

    -

    type input-stream

    +

    type input-stream

    input-stream

    -#### `type output-stream` +#### `type output-stream` [`output-stream`](#output_stream)

    -#### `type pollable` +#### `type pollable` [`pollable`](#pollable)

    -#### `type duration` +#### `type duration` [`duration`](#duration)

    -#### `type network` +#### `type network` [`network`](#network)

    -#### `type error-code` +#### `type error-code` [`error-code`](#error_code)

    -#### `type ip-socket-address` +#### `type ip-socket-address` [`ip-socket-address`](#ip_socket_address)

    -#### `type ip-address-family` +#### `type ip-address-family` [`ip-address-family`](#ip_address_family)

    -#### `enum shutdown-type` +#### `enum shutdown-type`

    Enum Cases
    -

    resource tcp-socket

    +

    resource tcp-socket

    A TCP socket resource.

    The socket can be in one of the following states:

    Params
    Return values
    -

    [method]tcp-socket.finish-bind: func

    +

    [method]tcp-socket.finish-bind: func

    Params
    Return values
    -

    [method]tcp-socket.start-connect: func

    +

    [method]tcp-socket.start-connect: func

    Connect to a remote endpoint.

    On success:

    Params
    Return values
    -

    [method]tcp-socket.finish-listen: func

    +

    [method]tcp-socket.finish-listen: func

    Params
    Return values
    -

    [method]tcp-socket.accept: func

    +

    [method]tcp-socket.accept: func

    Accept a new client socket.

    The returned socket is bound and in the connected state. The following properties are inherited from the listener socket:

      @@ -1412,13 +1414,13 @@ a pair of streams that can be used to read & write to the connection.

    Params
    Return values
    -

    [method]tcp-socket.local-address: func

    +

    [method]tcp-socket.local-address: func

    Get the bound local address.

    POSIX mentions:

    @@ -1439,13 +1441,13 @@ stored in the object pointed to by address is unspecified.

    Params
    Return values
    -

    [method]tcp-socket.remote-address: func

    +

    [method]tcp-socket.remote-address: func

    Get the remote address.

    Typical errors

      @@ -1460,35 +1462,35 @@ stored in the object pointed to by address is unspecified.

    Params
    Return values
    -

    [method]tcp-socket.is-listening: func

    +

    [method]tcp-socket.is-listening: func

    Whether the socket is in the listening state.

    Equivalent to the SO_ACCEPTCONN socket option.

    Params
    Return values
      -
    • bool
    • +
    • bool
    -

    [method]tcp-socket.address-family: func

    +

    [method]tcp-socket.address-family: func

    Whether this is a IPv4 or IPv6 socket.

    Equivalent to the SO_DOMAIN socket option.

    Params
    Return values
    -

    [method]tcp-socket.set-listen-backlog-size: func

    +

    [method]tcp-socket.set-listen-backlog-size: func

    Hints the desired listen queue size. Implementations are free to ignore this.

    If the provided value is 0, an invalid-argument error is returned. Any other value will never cause an error, but it might be silently clamped and/or rounded.

    @@ -1500,14 +1502,14 @@ Any other value will never cause an error, but it might be silently clamped and/
    Params
    Return values
    -

    [method]tcp-socket.keep-alive-enabled: func

    +

    [method]tcp-socket.keep-alive-enabled: func

    Enables or disables keepalive.

    The keepalive behavior can be adjusted using:

      @@ -1519,23 +1521,23 @@ These properties can be configured while keep-alive-enabled is fals

      Equivalent to the SO_KEEPALIVE socket option.

      Params
      Return values
      -

      [method]tcp-socket.set-keep-alive-enabled: func

      +

      [method]tcp-socket.set-keep-alive-enabled: func

      Params
      Return values
      -

      [method]tcp-socket.keep-alive-idle-time: func

      +

      [method]tcp-socket.keep-alive-idle-time: func

      Amount of time the connection has to be idle before TCP starts sending keepalive packets.

      If the provided value is 0, an invalid-argument error is returned. Any other value will never cause an error, but it might be silently clamped and/or rounded. @@ -1547,23 +1549,23 @@ I.e. after setting a value, reading the same setting back may return a different

    Params
    Return values
    -

    [method]tcp-socket.set-keep-alive-idle-time: func

    +

    [method]tcp-socket.set-keep-alive-idle-time: func

    Params
    Return values
    -

    [method]tcp-socket.keep-alive-interval: func

    +

    [method]tcp-socket.keep-alive-interval: func

    The time between keepalive packets.

    If the provided value is 0, an invalid-argument error is returned. Any other value will never cause an error, but it might be silently clamped and/or rounded. @@ -1575,23 +1577,23 @@ I.e. after setting a value, reading the same setting back may return a different

    Params
    Return values
    -

    [method]tcp-socket.set-keep-alive-interval: func

    +

    [method]tcp-socket.set-keep-alive-interval: func

    Params
    Return values
    -

    [method]tcp-socket.keep-alive-count: func

    +

    [method]tcp-socket.keep-alive-count: func

    The maximum amount of keepalive packets TCP should send before aborting the connection.

    If the provided value is 0, an invalid-argument error is returned. Any other value will never cause an error, but it might be silently clamped and/or rounded. @@ -1603,23 +1605,23 @@ I.e. after setting a value, reading the same setting back may return a different

    Params
    Return values
    -

    [method]tcp-socket.set-keep-alive-count: func

    +

    [method]tcp-socket.set-keep-alive-count: func

    Params
    Return values
    -

    [method]tcp-socket.hop-limit: func

    +

    [method]tcp-socket.hop-limit: func

    Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options.

    If the provided value is 0, an invalid-argument error is returned.

    Typical errors

    @@ -1628,23 +1630,23 @@ I.e. after setting a value, reading the same setting back may return a different
    Params
    Return values
    -

    [method]tcp-socket.set-hop-limit: func

    +

    [method]tcp-socket.set-hop-limit: func

    Params
    Return values
    -

    [method]tcp-socket.receive-buffer-size: func

    +

    [method]tcp-socket.receive-buffer-size: func

    The kernel buffer space reserved for sends/receives on this socket.

    If the provided value is 0, an invalid-argument error is returned. Any other value will never cause an error, but it might be silently clamped and/or rounded. @@ -1656,42 +1658,42 @@ I.e. after setting a value, reading the same setting back may return a different

    Params
    Return values
    -

    [method]tcp-socket.set-receive-buffer-size: func

    +

    [method]tcp-socket.set-receive-buffer-size: func

    Params
    Return values
    -

    [method]tcp-socket.send-buffer-size: func

    +

    [method]tcp-socket.send-buffer-size: func

    Params
    Return values
    -

    [method]tcp-socket.set-send-buffer-size: func

    +

    [method]tcp-socket.set-send-buffer-size: func

    Params
    Return values
    -

    [method]tcp-socket.subscribe: func

    +

    [method]tcp-socket.subscribe: func

    Create a pollable which can be used to poll for, or block on, completion of any of the asynchronous operations of this socket.

    When finish-bind, finish-listen, finish-connect or accept @@ -1707,13 +1709,13 @@ for more information.

    It's planned to be removed when future is natively supported in Preview3.

    Params
    Return values
    -

    [method]tcp-socket.shutdown: func

    +

    [method]tcp-socket.shutdown: func

    Initiate a graceful shutdown.

    • receive: The socket is not expecting to receive any data from @@ -1740,31 +1742,31 @@ has no effect and returns ok.

    Params
    Return values
    -

    Import interface wasi:sockets/tcp-create-socket@0.2.1

    +

    Import interface wasi:sockets/tcp-create-socket@0.2.2


    Types

    -

    type network

    +

    type network

    network

    -#### `type error-code` +#### `type error-code` [`error-code`](#error_code)

    -#### `type ip-address-family` +#### `type ip-address-family` [`ip-address-family`](#ip_address_family)

    -#### `type tcp-socket` +#### `type tcp-socket` [`tcp-socket`](#tcp_socket)

    ----

    Functions

    -

    create-tcp-socket: func

    +

    create-tcp-socket: func

    Create a new TCP socket.

    Similar to socket(AF_INET or AF_INET6, SOCK_STREAM, IPPROTO_TCP) in POSIX. On IPv6 sockets, IPV6_V6ONLY is enabled by default and can't be configured otherwise.

    @@ -1786,31 +1788,31 @@ is called, the socket is effectively an in-memory configuration object, unable t
    Params
    Return values
    -

    Import interface wasi:sockets/ip-name-lookup@0.2.1

    +

    Import interface wasi:sockets/ip-name-lookup@0.2.2


    Types

    -

    type pollable

    +

    type pollable

    pollable

    -#### `type network` +#### `type network` [`network`](#network)

    -#### `type error-code` +#### `type error-code` [`error-code`](#error_code)

    -#### `type ip-address` +#### `type ip-address` [`ip-address`](#ip_address)

    -#### `resource resolve-address-stream` +#### `resource resolve-address-stream`


    Functions

    -

    resolve-addresses: func

    +

    resolve-addresses: func

    Resolve an internet host name to a list of IP addresses.

    Unicode domain names are automatically converted to ASCII using IDNA encoding. If the input is an IP address string, the address is parsed and returned @@ -1832,14 +1834,14 @@ to (asynchronously) fetch the results.

    Params
    Return values
    -

    [method]resolve-address-stream.resolve-next-address: func

    +

    [method]resolve-address-stream.resolve-next-address: func

    Returns the next address from the resolver.

    This function should be called multiple times. On each call, it will return the next address in connection order preference. If all @@ -1854,21 +1856,21 @@ addresses have been exhausted, this function returns none.

    Params
    Return values
    -

    [method]resolve-address-stream.subscribe: func

    +

    [method]resolve-address-stream.subscribe: func

    Create a pollable which will resolve once the stream is ready for I/O.

    Note: this function is here for WASI Preview2 only. It's planned to be removed when future is natively supported in Preview3.

    Params
    Return values
    diff --git a/wit/deps.lock b/wit/deps.lock index 2b50429..5cab24d 100644 --- a/wit/deps.lock +++ b/wit/deps.lock @@ -1,9 +1,9 @@ [clocks] url = "https://github.com/WebAssembly/wasi-clocks/archive/main.tar.gz" -sha256 = "ea9d69ee803bc176e23e5268f5e24a2ac485dd1f62a0ab4c748e9d3f901f576f" -sha512 = "5efc22927c46cd56c41e5549ec775561c7fac2ea0d365abc0b55396d9475a7c9f984077a81f84a44a726f1c008fd2fadbffffa4fa53ecd5fbfd05afd379ab428" +sha256 = "c2da62619d1067646316e8592b583d77036d778e28b1154353e0825956b3d6aa" +sha512 = "4d409fc38b31646fc5de70160e81bd3fa67f9c99b4d24543b4fd40a922c7545739869521b8a997efb675d0816de8b001b6af7950e0cb0bc823d89b9f07b286c4" [io] url = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz" -sha256 = "2a74bd811adc46b5a0f19827ddbde89870e52b17615f4d0873f06fd977250caf" -sha512 = "94624f00c66e66203592cee820f80b1ba91ecdb71f682c154f25eaf71f8d8954197dcb64503bc21e72ed5e812af7eae876df47b7eb727b02db3a74a7ce0aefca" +sha256 = "6d8dbfaaaa685167c1829616dc7265f5f3cb776845879555612d56544f6d9bfc" +sha512 = "52219562c4183503169cd2947b8164e1c96974500a5adf15bbf382c5992a10a626cc89c3b319204aeda6698ce59cbca2c42f98f7fde296aa77b9db4b41154dbe" diff --git a/wit/deps/clocks/monotonic-clock.wit b/wit/deps/clocks/monotonic-clock.wit index 3c24840..233cace 100644 --- a/wit/deps/clocks/monotonic-clock.wit +++ b/wit/deps/clocks/monotonic-clock.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.1; +package wasi:clocks@0.2.2; /// WASI Monotonic Clock is a clock API intended to let users measure elapsed /// time. /// @@ -10,7 +10,7 @@ package wasi:clocks@0.2.1; @since(version = 0.2.0) interface monotonic-clock { @since(version = 0.2.0) - use wasi:io/poll@0.2.1.{pollable}; + use wasi:io/poll@0.2.2.{pollable}; /// An instant in time, in nanoseconds. An instant is relative to an /// unspecified initial value, and can only be compared to instances from diff --git a/wit/deps/clocks/timezone.wit b/wit/deps/clocks/timezone.wit index 212da66..349fb57 100644 --- a/wit/deps/clocks/timezone.wit +++ b/wit/deps/clocks/timezone.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.1; +package wasi:clocks@0.2.2; @unstable(feature = clocks-timezone) interface timezone { diff --git a/wit/deps/clocks/wall-clock.wit b/wit/deps/clocks/wall-clock.wit index 6be069a..ec05a1f 100644 --- a/wit/deps/clocks/wall-clock.wit +++ b/wit/deps/clocks/wall-clock.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.1; +package wasi:clocks@0.2.2; /// 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. diff --git a/wit/deps/clocks/world.wit b/wit/deps/clocks/world.wit index 9251ac6..e36802c 100644 --- a/wit/deps/clocks/world.wit +++ b/wit/deps/clocks/world.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.1; +package wasi:clocks@0.2.2; @since(version = 0.2.0) world imports { diff --git a/wit/deps/io/error.wit b/wit/deps/io/error.wit index 4ea29c4..717135f 100644 --- a/wit/deps/io/error.wit +++ b/wit/deps/io/error.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.1; +package wasi:io@0.2.2; @since(version = 0.2.0) interface error { diff --git a/wit/deps/io/poll.wit b/wit/deps/io/poll.wit index b25ac72..49c1c5e 100644 --- a/wit/deps/io/poll.wit +++ b/wit/deps/io/poll.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.1; +package wasi:io@0.2.2; /// A poll API intended to let users wait for I/O events on multiple handles /// at once. diff --git a/wit/deps/io/streams.wit b/wit/deps/io/streams.wit index b697e24..330f709 100644 --- a/wit/deps/io/streams.wit +++ b/wit/deps/io/streams.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.1; +package wasi:io@0.2.2; /// WASI I/O is an I/O abstraction API which is currently focused on providing /// stream types. @@ -18,6 +18,9 @@ interface streams { /// 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`. last-operation-failed(error), /// The stream is closed: no more input will be accepted by the /// stream. A closed output-stream will return this error on all @@ -205,6 +208,7 @@ interface streams { /// The created `pollable` is a child resource of the `output-stream`. /// Implementations may trap if the `output-stream` is dropped before /// all derived `pollable`s created with this function are dropped. + @since(version = 0.2.0) subscribe: func() -> pollable; /// Write zeroes to a stream. diff --git a/wit/deps/io/world.wit b/wit/deps/io/world.wit index 6405a4e..f7001cc 100644 --- a/wit/deps/io/world.wit +++ b/wit/deps/io/world.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.1; +package wasi:io@0.2.2; @since(version = 0.2.0) world imports { diff --git a/wit/ip-name-lookup.wit b/wit/ip-name-lookup.wit index dc56f30..8d6dcec 100644 --- a/wit/ip-name-lookup.wit +++ b/wit/ip-name-lookup.wit @@ -1,7 +1,7 @@ @since(version = 0.2.0) interface ip-name-lookup { @since(version = 0.2.0) - use wasi:io/poll@0.2.1.{pollable}; + use wasi:io/poll@0.2.2.{pollable}; @since(version = 0.2.0) use network.{network, error-code, ip-address}; diff --git a/wit/network.wit b/wit/network.wit index 993c4ce..7f2d86a 100644 --- a/wit/network.wit +++ b/wit/network.wit @@ -1,7 +1,7 @@ @since(version = 0.2.0) interface network { @unstable(feature = network-error-code) - use wasi:io/error@0.2.1.{error}; + use wasi:io/error@0.2.2.{error}; /// An opaque resource that represents access to (a subset of) the network. /// This enables context-based security for networking. diff --git a/wit/tcp.wit b/wit/tcp.wit index bae5a29..91f421b 100644 --- a/wit/tcp.wit +++ b/wit/tcp.wit @@ -1,11 +1,11 @@ @since(version = 0.2.0) interface tcp { @since(version = 0.2.0) - use wasi:io/streams@0.2.1.{input-stream, output-stream}; + use wasi:io/streams@0.2.2.{input-stream, output-stream}; @since(version = 0.2.0) - use wasi:io/poll@0.2.1.{pollable}; + use wasi:io/poll@0.2.2.{pollable}; @since(version = 0.2.0) - use wasi:clocks/monotonic-clock@0.2.1.{duration}; + use wasi:clocks/monotonic-clock@0.2.2.{duration}; @since(version = 0.2.0) use network.{network, error-code, ip-socket-address, ip-address-family}; diff --git a/wit/udp.wit b/wit/udp.wit index b289e49..328d916 100644 --- a/wit/udp.wit +++ b/wit/udp.wit @@ -1,7 +1,7 @@ @since(version = 0.2.0) interface udp { @since(version = 0.2.0) - use wasi:io/poll@0.2.1.{pollable}; + use wasi:io/poll@0.2.2.{pollable}; @since(version = 0.2.0) use network.{network, error-code, ip-socket-address, ip-address-family}; diff --git a/wit/world.wit b/wit/world.wit index a1d4267..6e349c7 100644 --- a/wit/world.wit +++ b/wit/world.wit @@ -1,4 +1,4 @@ -package wasi:sockets@0.2.1; +package wasi:sockets@0.2.2; @since(version = 0.2.0) world imports {