From 99bb7ac4d705b3d140bf34b0696fe49485baf91b Mon Sep 17 00:00:00 2001 From: Yosh Date: Thu, 5 Dec 2024 22:32:01 +0100 Subject: [PATCH 1/2] v0.2.3 --- imports.md | 132 ++++++++++++++++------------ wit/deps.lock | 8 +- wit/deps/clocks/monotonic-clock.wit | 4 +- wit/deps/clocks/timezone.wit | 2 +- wit/deps/clocks/wall-clock.wit | 2 +- wit/deps/clocks/world.wit | 2 +- wit/deps/io/error.wit | 2 +- wit/deps/io/poll.wit | 2 +- wit/deps/io/streams.wit | 2 +- wit/deps/io/world.wit | 2 +- wit/ip-name-lookup.wit | 2 +- wit/network.wit | 2 +- wit/tcp.wit | 6 +- wit/udp.wit | 2 +- wit/world.wit | 2 +- 15 files changed, 97 insertions(+), 75 deletions(-) diff --git a/imports.md b/imports.md index 661c217..59d7d69 100644 --- a/imports.md +++ b/imports.md @@ -2,24 +2,60 @@ -

Import interface wasi:sockets/network@0.2.2

+

Import interface wasi:io/error@0.2.3


Types

-

resource network

+

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.

+

In the wasi:io package, this resource is returned through the +wasi:io/streams/stream-error type.

+

To provide more specific error information, other interfaces may +offer functions to "downcast" 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 +wasi:filesystem/types/filesystem-error-code, which takes a borrow<error> +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

+

Returns a string that is suitable to assist humans in debugging +this error.

+

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.

+
Params
+ +
Return values
+ +

Import interface wasi:sockets/network@0.2.3

+
+

Types

+

type error

+

error

+

+#### `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.

@@ -209,7 +245,26 @@ supported size.
  • ipv4: ipv4-socket-address
  • ipv6: ipv6-socket-address
  • -

    Import interface wasi:sockets/instance-network@0.2.2

    +
    +

    Functions

    +

    network-error-code: func

    +

    Attempts to extract a network-related error-code from the stream +error provided.

    +

    Stream operations which return stream-error::last-operation-failed +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.

    +

    Note that this function is fallible because not all stream-related +errors are network-related errors.

    +
    Params
    + +
    Return values
    + +

    Import interface wasi:sockets/instance-network@0.2.3

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


    Types

    @@ -224,7 +279,7 @@ supported size. -

    Import interface wasi:io/poll@0.2.2

    +

    Import interface wasi:io/poll@0.2.3

    A poll API intended to let users wait for I/O events on multiple handles at once.


    @@ -277,7 +332,7 @@ being ready for I/O.

    -

    Import interface wasi:sockets/udp@0.2.2

    +

    Import interface wasi:sockets/udp@0.2.3


    Types

    type pollable

    @@ -691,7 +746,7 @@ It's planned to be removed when future is natively supported in Pre -

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

    +

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


    Types

    type network

    @@ -736,40 +791,7 @@ the socket is effectively an in-memory configuration object, unable to communica -

    Import interface wasi:io/error@0.2.2

    -
    -

    Types

    -

    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.

    -

    In the wasi:io package, this resource is returned through the -wasi:io/streams/stream-error type.

    -

    To provide more specific error information, other interfaces may -offer functions to "downcast" 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 -wasi:filesystem/types/filesystem-error-code, which takes a borrow<error> -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

    -

    Returns a string that is suitable to assist humans in debugging -this error.

    -

    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.

    -
    Params
    - -
    Return values
    - -

    Import interface wasi:io/streams@0.2.2

    +

    Import interface wasi:io/streams@0.2.3

    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; @@ -1099,7 +1121,7 @@ is ready for reading, before performing the splice.

    -

    Import interface wasi:clocks/monotonic-clock@0.2.2

    +

    Import interface wasi:clocks/monotonic-clock@0.2.3

    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 @@ -1158,7 +1180,7 @@ elapsed from the time this function is invoked.

    -

    Import interface wasi:sockets/tcp@0.2.2

    +

    Import interface wasi:sockets/tcp@0.2.3


    Types

    type input-stream

    @@ -1749,7 +1771,7 @@ has no effect and returns ok.

    -

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

    +

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


    Types

    type network

    @@ -1794,7 +1816,7 @@ is called, the socket is effectively an in-memory configuration object, unable t -

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

    +

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


    Types

    type pollable

    diff --git a/wit/deps.lock b/wit/deps.lock index 5cab24d..316cbaa 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 = "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" diff --git a/wit/deps/clocks/monotonic-clock.wit b/wit/deps/clocks/monotonic-clock.wit index 233cace..c676fb8 100644 --- a/wit/deps/clocks/monotonic-clock.wit +++ b/wit/deps/clocks/monotonic-clock.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.2; +package wasi:clocks@0.2.3; /// WASI Monotonic Clock is a clock API intended to let users measure elapsed /// time. /// @@ -10,7 +10,7 @@ package wasi:clocks@0.2.2; @since(version = 0.2.0) interface monotonic-clock { @since(version = 0.2.0) - use wasi:io/poll@0.2.2.{pollable}; + use wasi:io/poll@0.2.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 diff --git a/wit/deps/clocks/timezone.wit b/wit/deps/clocks/timezone.wit index 349fb57..b43e93b 100644 --- a/wit/deps/clocks/timezone.wit +++ b/wit/deps/clocks/timezone.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.2; +package wasi:clocks@0.2.3; @unstable(feature = clocks-timezone) interface timezone { diff --git a/wit/deps/clocks/wall-clock.wit b/wit/deps/clocks/wall-clock.wit index ec05a1f..e00ce08 100644 --- a/wit/deps/clocks/wall-clock.wit +++ b/wit/deps/clocks/wall-clock.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.2; +package wasi:clocks@0.2.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. diff --git a/wit/deps/clocks/world.wit b/wit/deps/clocks/world.wit index e36802c..05f04f7 100644 --- a/wit/deps/clocks/world.wit +++ b/wit/deps/clocks/world.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.2.2; +package wasi:clocks@0.2.3; @since(version = 0.2.0) world imports { diff --git a/wit/deps/io/error.wit b/wit/deps/io/error.wit index 717135f..97c6068 100644 --- a/wit/deps/io/error.wit +++ b/wit/deps/io/error.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.2; +package wasi:io@0.2.3; @since(version = 0.2.0) interface error { diff --git a/wit/deps/io/poll.wit b/wit/deps/io/poll.wit index 49c1c5e..9bcbe8e 100644 --- a/wit/deps/io/poll.wit +++ b/wit/deps/io/poll.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.2; +package wasi:io@0.2.3; /// 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 330f709..0de0846 100644 --- a/wit/deps/io/streams.wit +++ b/wit/deps/io/streams.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.2; +package wasi:io@0.2.3; /// WASI I/O is an I/O abstraction API which is currently focused on providing /// stream types. diff --git a/wit/deps/io/world.wit b/wit/deps/io/world.wit index f7001cc..f1d2102 100644 --- a/wit/deps/io/world.wit +++ b/wit/deps/io/world.wit @@ -1,4 +1,4 @@ -package wasi:io@0.2.2; +package wasi:io@0.2.3; @since(version = 0.2.0) world imports { diff --git a/wit/ip-name-lookup.wit b/wit/ip-name-lookup.wit index d3ab88a..c1d8a47 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.2.{pollable}; + use wasi:io/poll@0.2.3.{pollable}; @since(version = 0.2.0) use network.{network, error-code, ip-address}; diff --git a/wit/network.wit b/wit/network.wit index 7f2d86a..f3f60a3 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.2.{error}; + use wasi:io/error@0.2.3.{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 728822d..b4cd87f 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.2.{input-stream, output-stream}; + use wasi:io/streams@0.2.3.{input-stream, output-stream}; @since(version = 0.2.0) - use wasi:io/poll@0.2.2.{pollable}; + use wasi:io/poll@0.2.3.{pollable}; @since(version = 0.2.0) - use wasi:clocks/monotonic-clock@0.2.2.{duration}; + use wasi:clocks/monotonic-clock@0.2.3.{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 d8acb2d..01901ca 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.2.{pollable}; + use wasi:io/poll@0.2.3.{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 6e349c7..2f0ad0d 100644 --- a/wit/world.wit +++ b/wit/world.wit @@ -1,4 +1,4 @@ -package wasi:sockets@0.2.2; +package wasi:sockets@0.2.3; @since(version = 0.2.0) world imports { From cb54c0264d58eecf964e6ee14d2b381c5d48f4bf Mon Sep 17 00:00:00 2001 From: Yosh Date: Thu, 5 Dec 2024 22:38:37 +0100 Subject: [PATCH 2/2] Update imports.md --- imports.md | 92 +++++++++++++++++++++--------------------------------- 1 file changed, 35 insertions(+), 57 deletions(-) diff --git a/imports.md b/imports.md index 59d7d69..9ae4637 100644 --- a/imports.md +++ b/imports.md @@ -2,12 +2,12 @@ -

    Import interface wasi:io/error@0.2.3

    -
    -

    Types

    -

    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.

    -

    In the wasi:io package, this resource is returned through the -wasi:io/streams/stream-error type.

    -

    To provide more specific error information, other interfaces may -offer functions to "downcast" 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 -wasi:filesystem/types/filesystem-error-code, which takes a borrow<error> -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

    -

    Returns a string that is suitable to assist humans in debugging -this error.

    -

    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.

    -
    Params
    - -
    Return values
    -

    Import interface wasi:sockets/network@0.2.3


    Types

    -

    type error

    -

    error

    -

    -#### `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.

    @@ -245,25 +209,6 @@ supported size.
  • ipv4: ipv4-socket-address
  • ipv6: ipv6-socket-address
  • -
    -

    Functions

    -

    network-error-code: func

    -

    Attempts to extract a network-related error-code from the stream -error provided.

    -

    Stream operations which return stream-error::last-operation-failed -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.

    -

    Note that this function is fallible because not all stream-related -errors are network-related errors.

    -
    Params
    - -
    Return values
    -

    Import interface wasi:sockets/instance-network@0.2.3

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


    @@ -791,6 +736,39 @@ the socket is effectively an in-memory configuration object, unable to communica +

    Import interface wasi:io/error@0.2.3

    +
    +

    Types

    +

    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.

    +

    In the wasi:io package, this resource is returned through the +wasi:io/streams/stream-error type.

    +

    To provide more specific error information, other interfaces may +offer functions to "downcast" 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 +wasi:filesystem/types/filesystem-error-code, which takes a borrow<error> +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

    +

    Returns a string that is suitable to assist humans in debugging +this error.

    +

    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.

    +
    Params
    + +
    Return values
    +

    Import interface wasi:io/streams@0.2.3

    WASI I/O is an I/O abstraction API which is currently focused on providing stream types.