diff --git a/imports.md b/imports.md index f494ad3..9b9a73d 100644 --- a/imports.md +++ b/imports.md @@ -2,12 +2,12 @@ +

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:sockets/network@0.2.2


Types

-

resource network

+

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,6 +245,25 @@ 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.2

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


    @@ -563,7 +618,7 @@ I.e. after setting a value, reading the same setting back may return a different

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

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

    Params

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

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

    Params

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

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

    Params