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.
The abbreviated name of the timezone to display to a user. The name
-`UTC` indicates Coordinated Universal Time. Otherwise, this should
-reference local standards for the name of the time zone.
-
In implementations that do not expose an actual time zone, this
-should be the string UTC.
-
In time zones that do not have an applicable name, a formatted
-representation of the UTC offset may be returned, such as -04:00.
Return information needed to display the given datetime. This includes
-the UTC offset, the time zone name, and a flag indicating whether
-daylight saving time is active.
-
If the timezone cannot be determined for the given datetime, return a
-timezone-display for UTC with a utc-offset of 0 and no daylight
-saving time.
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.
This interface defines all of the types and methods for implementing
HTTP Requests and Responses, both incoming and outgoing, as well as
their headers, trailers, and bodies.
@@ -644,7 +588,7 @@ their headers, trailers, and bodies.
#### `type output-stream`
[`output-stream`](#output_stream)
Attempts to extract a http-related error from the stream error
+
Attempts to extract a http-related error from the wasi:io 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
-http-related information about the error to return.
-
Note that this function is fallible because not all stream-related errors
-are http-related errors.
+
Stream operations which return
+wasi:io/stream/stream-error::last-operation-failed have a payload of
+type wasi:io/error/error with more information about the operation
+that failed. This payload can be passed through to this function to see
+if there's http-related information about the error to return.
+
Note that this function is fallible because not all io-errors are
+http-related errors.
diff --git a/wit/deps.lock b/wit/deps.lock
index f55de7c..661a351 100644
--- a/wit/deps.lock
+++ b/wit/deps.lock
@@ -1,29 +1,29 @@
[cli]
url = "https://github.com/WebAssembly/wasi-cli/archive/main.tar.gz"
-sha256 = "bf57bb59e137f1dea6521409137e46dbdcd0a78d419ac2313b59fb21332718cd"
-sha512 = "36a793525eba4921f0bd55bc445465e86fc7ff8fcf3e5bb61108d35e4d791950b107b456ccadf65897a0a5cd201a5955741c9c1fecb533fca99e8bae478a2dbf"
+sha256 = "fb029d0f9468fcb404a079a58fafd9265ef99c0ee1350835348da7b6e105c597"
+sha512 = "8602e881281adc67b1ac5a4eb0888636d6f50d15bd14e36dcc446a51551f3f9bb3e9eabb776d723bb113bf1e26a702c5042de095e66e897c3d3cf689e0b7d4f9"
[clocks]
url = "https://github.com/WebAssembly/wasi-clocks/archive/main.tar.gz"
-sha256 = "8d6b9f7a8bf9466bdc68043c33e054878fdf09c1cc69c19c99eeadd3bb257a90"
-sha512 = "21b65d911930c4512bb3caa08459283fc70b1ccc5159313092334cffd6662fb92cfe90577b51829ef363e2d02530802c88f2a1f82db43964d1f8bff7ecbc794b"
+sha256 = "89da8eca4cd195516574c89c5b3c24a7b5af3ff2565c16753d20d3bdbc5fc60f"
+sha512 = "244079b3f592d58478a97adbd0bee8d49ae9dd1a3e435651ee40997b50da9fe62cfaba7e3ec7f7406d7d0288d278a43a3a0bc5150226ba40ce0f8ac6d33f7ddb"
[filesystem]
url = "https://github.com/WebAssembly/wasi-filesystem/archive/main.tar.gz"
-sha256 = "c05155f44cf5798d15a16eaf9cdfb065d05914ed4710421a7448bb61c6decf3a"
-sha512 = "fb30ea13678d3f3d2002b2cc1f6dae99ee6a06eae7c408c0d558f21e5039979dd80c8ced46b1a7629ce8b050820d81462093f7b4a733ff706d0258bf5dea5657"
+sha256 = "05952bbc98895aa3aeda6c765a3e521016de59f993f3b60394c724640935c09c"
+sha512 = "2c242489801a75466986fe014d730fb3aa7b5c6e56a230c8735e6672711b58bcbe92ba78a341b78fc3ac69339e55d3859d8bb14410230f0371ee30dbd83add64"
[io]
url = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
-sha256 = "fb76f4449eea54d06b56fc6a7ca988da51bd84a54d2021cf18da67b5e2c7ebcf"
-sha512 = "c005e2a91522958a9537827a49ae344e1cb39d66e85492901a86bcc7e322ba8d0a7f1a02c9b9f840c123b4ad97e297355fac98d4822536d1426d1096dd1d73ac"
+sha256 = "f2e6127b235c37c06be675a904d6acf08db953ea688d78c42892c6ad3bd194e4"
+sha512 = "32feefbc115c34bf6968cb6e9dc15e755698ee90648e5a5d84448917c36a318bd61b401195eb64330e2475e1d098bfb8dee1440d594a68e0797748762bd84ae5"
[random]
url = "https://github.com/WebAssembly/wasi-random/archive/main.tar.gz"
-sha256 = "7d7c882d50baeb054a754b5766d46f5eed35a4470d887fc8b45121bfc7ac8701"
-sha512 = "4b8aad54da50aa44d35f6e5eea87c67bbcedd610650500ffe350c8c8d26f7ee14c49c4c4cc51ebd0ae607459095092625f27a451e52232c575b460334b5a0606"
+sha256 = "11afcbff9920f5f1f72b6764d01e59a5faa2c671f0c59f0c9b405778f3708745"
+sha512 = "cc4fa3d178559a89d9d6a376e3359b892158d1e73317c5db1f797ebc6b0b57abf2422797648d5b2b494c50cf9360720bc451cc27e15def7d278ba875805ccbf5"
[sockets]
url = "https://github.com/WebAssembly/wasi-sockets/archive/main.tar.gz"
-sha256 = "e9cc9bf3e809c17f7a100f9498056e435eea133bcb0f1abd8833261f3e5ff067"
-sha512 = "1917e06807dc5f9f0993fbffbb9a6c8c36ab25a14ba775ffee939aca458ecd52ee796764708381f7f4166665cfcf11a5d47dc756a1e38f291b270678455b3a02"
+sha256 = "b5c2e9cc87cefbaef06bbe9978f9bc336da9feee2d51747bc28e10164fc46c39"
+sha512 = "3aea6fe0c768b27d5c5cb3adab5e60dc936198f8b677c2cf6c4d57a0460db87eb779e0b577f1240fb2a6bf3ade49919fbffe39b0137bce3242343e6091cc7510"
diff --git a/wit/deps/cli/command.wit b/wit/deps/cli/command.wit
index 86c9c73..74811d3 100644
--- a/wit/deps/cli/command.wit
+++ b/wit/deps/cli/command.wit
@@ -1,4 +1,4 @@
-package wasi:cli;
+package wasi:cli@0.2.0-rc-2023-11-10;
world command {
include reactor;
diff --git a/wit/deps/cli/reactor.wit b/wit/deps/cli/reactor.wit
index 6bd780e..eafa2fd 100644
--- a/wit/deps/cli/reactor.wit
+++ b/wit/deps/cli/reactor.wit
@@ -1,23 +1,22 @@
-package wasi:cli;
+package wasi:cli@0.2.0-rc-2023-11-10;
world reactor {
- import wasi:clocks/wall-clock;
- import wasi:clocks/monotonic-clock;
- import wasi:clocks/timezone;
- import wasi:filesystem/types;
- import wasi:filesystem/preopens;
- import wasi:sockets/instance-network;
- import wasi:sockets/ip-name-lookup;
- import wasi:sockets/network;
- import wasi:sockets/tcp-create-socket;
- import wasi:sockets/tcp;
- import wasi:sockets/udp-create-socket;
- import wasi:sockets/udp;
- import wasi:random/random;
- import wasi:random/insecure;
- import wasi:random/insecure-seed;
- import wasi:io/poll;
- import wasi:io/streams;
+ import wasi:clocks/wall-clock@0.2.0-rc-2023-11-10;
+ import wasi:clocks/monotonic-clock@0.2.0-rc-2023-11-10;
+ import wasi:filesystem/types@0.2.0-rc-2023-11-10;
+ import wasi:filesystem/preopens@0.2.0-rc-2023-11-10;
+ import wasi:sockets/instance-network@0.2.0-rc-2023-11-10;
+ import wasi:sockets/ip-name-lookup@0.2.0-rc-2023-11-10;
+ import wasi:sockets/network@0.2.0-rc-2023-11-10;
+ import wasi:sockets/tcp-create-socket@0.2.0-rc-2023-11-10;
+ import wasi:sockets/tcp@0.2.0-rc-2023-11-10;
+ import wasi:sockets/udp-create-socket@0.2.0-rc-2023-11-10;
+ import wasi:sockets/udp@0.2.0-rc-2023-11-10;
+ import wasi:random/random@0.2.0-rc-2023-11-10;
+ import wasi:random/insecure@0.2.0-rc-2023-11-10;
+ import wasi:random/insecure-seed@0.2.0-rc-2023-11-10;
+ import wasi:io/poll@0.2.0-rc-2023-11-10;
+ import wasi:io/streams@0.2.0-rc-2023-11-10;
import environment;
import exit;
diff --git a/wit/deps/cli/stdio.wit b/wit/deps/cli/stdio.wit
index 1bb6c55..1b653b6 100644
--- a/wit/deps/cli/stdio.wit
+++ b/wit/deps/cli/stdio.wit
@@ -1,17 +1,17 @@
interface stdin {
- use wasi:io/streams.{input-stream};
+ use wasi:io/streams@0.2.0-rc-2023-11-10.{input-stream};
get-stdin: func() -> input-stream;
}
interface stdout {
- use wasi:io/streams.{output-stream};
+ use wasi:io/streams@0.2.0-rc-2023-11-10.{output-stream};
get-stdout: func() -> output-stream;
}
interface stderr {
- use wasi:io/streams.{output-stream};
+ use wasi:io/streams@0.2.0-rc-2023-11-10.{output-stream};
get-stderr: func() -> output-stream;
}
diff --git a/wit/deps/clocks/monotonic-clock.wit b/wit/deps/clocks/monotonic-clock.wit
index afacdbb..09ef32c 100644
--- a/wit/deps/clocks/monotonic-clock.wit
+++ b/wit/deps/clocks/monotonic-clock.wit
@@ -1,3 +1,4 @@
+package wasi:clocks@0.2.0-rc-2023-11-10;
/// WASI Monotonic Clock is a clock API intended to let users measure elapsed
/// time.
///
@@ -9,7 +10,7 @@
///
/// It is intended for measuring elapsed time.
interface monotonic-clock {
- use wasi:io/poll.{pollable};
+ use wasi:io/poll@0.2.0-rc-2023-11-10.{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
deleted file mode 100644
index e717e7b..0000000
--- a/wit/deps/clocks/timezone.wit
+++ /dev/null
@@ -1,48 +0,0 @@
-interface timezone {
- use wall-clock.{datetime};
-
- /// Return information needed to display the given `datetime`. This includes
- /// the UTC offset, the time zone name, and a flag indicating whether
- /// daylight saving time is active.
- ///
- /// If the timezone cannot be determined for the given `datetime`, return a
- /// `timezone-display` for `UTC` with a `utc-offset` of 0 and no daylight
- /// saving time.
- display: func(when: datetime) -> timezone-display;
-
- /// The same as `display`, but only return the UTC offset.
- utc-offset: func(when: datetime) -> s32;
-
- /// Information useful for displaying the timezone of a specific `datetime`.
- ///
- /// This information may vary within a single `timezone` to reflect daylight
- /// saving time adjustments.
- record timezone-display {
- /// The number of seconds difference between UTC time and the local
- /// time of the timezone.
- ///
- /// The returned value will always be less than 86400 which is the
- /// number of seconds in a day (24*60*60).
- ///
- /// In implementations that do not expose an actual time zone, this
- /// should return 0.
- utc-offset: s32,
-
- /// The abbreviated name of the timezone to display to a user. The name
- /// `UTC` indicates Coordinated Universal Time. Otherwise, this should
- /// reference local standards for the name of the time zone.
- ///
- /// In implementations that do not expose an actual time zone, this
- /// should be the string `UTC`.
- ///
- /// In time zones that do not have an applicable name, a formatted
- /// representation of the UTC offset may be returned, such as `-04:00`.
- name: string,
-
- /// Whether daylight saving time is active.
- ///
- /// In implementations that do not expose an actual time zone, this
- /// should return false.
- in-daylight-saving-time: bool,
- }
-}
diff --git a/wit/deps/clocks/wall-clock.wit b/wit/deps/clocks/wall-clock.wit
index c395649..8abb9a0 100644
--- a/wit/deps/clocks/wall-clock.wit
+++ b/wit/deps/clocks/wall-clock.wit
@@ -1,3 +1,4 @@
+package wasi:clocks@0.2.0-rc-2023-11-10;
/// 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 3295ba8..8fa080f 100644
--- a/wit/deps/clocks/world.wit
+++ b/wit/deps/clocks/world.wit
@@ -1,7 +1,6 @@
-package wasi:clocks;
+package wasi:clocks@0.2.0-rc-2023-11-10;
world imports {
import monotonic-clock;
import wall-clock;
- import timezone;
}
diff --git a/wit/deps/filesystem/preopens.wit b/wit/deps/filesystem/preopens.wit
index 3f787ac..95ec678 100644
--- a/wit/deps/filesystem/preopens.wit
+++ b/wit/deps/filesystem/preopens.wit
@@ -1,3 +1,5 @@
+package wasi:filesystem@0.2.0-rc-2023-11-10;
+
interface preopens {
use types.{descriptor};
diff --git a/wit/deps/filesystem/types.wit b/wit/deps/filesystem/types.wit
index 7ac147f..059722a 100644
--- a/wit/deps/filesystem/types.wit
+++ b/wit/deps/filesystem/types.wit
@@ -1,3 +1,4 @@
+package wasi:filesystem@0.2.0-rc-2023-11-10;
/// WASI filesystem is a filesystem API primarily intended to let users run WASI
/// programs that access their files on their existing filesystems, without
/// significant overhead.
@@ -23,8 +24,8 @@
///
/// [WASI filesystem path resolution]: https://github.com/WebAssembly/wasi-filesystem/blob/main/path-resolution.md
interface types {
- use wasi:io/streams.{input-stream, output-stream, error};
- use wasi:clocks/wall-clock.{datetime};
+ use wasi:io/streams@0.2.0-rc-2023-11-10.{input-stream, output-stream, error};
+ use wasi:clocks/wall-clock@0.2.0-rc-2023-11-10.{datetime};
/// File size or length of a region within a file.
type filesize = u64;
@@ -142,29 +143,6 @@ interface types {
truncate,
}
- /// Permissions mode used by `open-at`, `change-file-permissions-at`, and
- /// similar.
- flags modes {
- /// True if the resource is considered readable by the containing
- /// filesystem.
- readable,
- /// True if the resource is considered writable by the containing
- /// filesystem.
- writable,
- /// True if the resource is considered executable by the containing
- /// filesystem. This does not apply to directories.
- executable,
- }
-
- /// Access type used by `access-at`.
- variant access-type {
- /// Test for readability, writeability, or executability.
- access(modes),
-
- /// Test whether the path exists.
- exists,
- }
-
/// Number of hard links to an inode.
type link-count = u64;
@@ -538,8 +516,6 @@ interface types {
open-flags: open-flags,
/// Flags to use for the resulting descriptor.
%flags: descriptor-flags,
- /// Permissions to use when creating a new file.
- modes: modes
) -> result;
/// Read the contents of a symbolic link.
@@ -588,25 +564,6 @@ interface types {
new-path: string,
) -> result<_, error-code>;
- /// Check accessibility of a filesystem path.
- ///
- /// Check whether the given filesystem path names an object which is
- /// readable, writable, or executable, or whether it exists.
- ///
- /// This does not a guarantee that subsequent accesses will succeed, as
- /// filesystem permissions may be modified asynchronously by external
- /// entities.
- ///
- /// Note: This is similar to `faccessat` with the `AT_EACCESS` flag in POSIX.
- access-at: func(
- /// Flags determining the method of how the path is resolved.
- path-flags: path-flags,
- /// The relative path to check.
- path: string,
- /// The type of check to perform.
- %type: access-type
- ) -> result<_, error-code>;
-
/// Unlink a filesystem object that is not a directory.
///
/// Return `error-code::is-directory` if the path refers to a directory.
@@ -616,40 +573,6 @@ interface types {
path: string,
) -> result<_, error-code>;
- /// Change the permissions of a filesystem object that is not a directory.
- ///
- /// Note that the ultimate meanings of these permissions is
- /// filesystem-specific.
- ///
- /// Note: This is similar to `fchmodat` in POSIX.
- change-file-permissions-at: func(
- /// Flags determining the method of how the path is resolved.
- path-flags: path-flags,
- /// The relative path to operate on.
- path: string,
- /// The new permissions for the filesystem object.
- modes: modes,
- ) -> result<_, error-code>;
-
- /// Change the permissions of a directory.
- ///
- /// Note that the ultimate meanings of these permissions is
- /// filesystem-specific.
- ///
- /// Unlike in POSIX, the `executable` flag is not reinterpreted as a "search"
- /// flag. `read` on a directory implies readability and searchability, and
- /// `execute` is not valid for directories.
- ///
- /// Note: This is similar to `fchmodat` in POSIX.
- change-directory-permissions-at: func(
- /// Flags determining the method of how the path is resolved.
- path-flags: path-flags,
- /// The relative path to operate on.
- path: string,
- /// The new permissions for the directory.
- modes: modes,
- ) -> result<_, error-code>;
-
/// Test whether two descriptors refer to the same filesystem object.
///
/// In POSIX, this corresponds to testing whether the two descriptors have the
diff --git a/wit/deps/filesystem/world.wit b/wit/deps/filesystem/world.wit
index bd47294..285e0ba 100644
--- a/wit/deps/filesystem/world.wit
+++ b/wit/deps/filesystem/world.wit
@@ -1,4 +1,4 @@
-package wasi:filesystem;
+package wasi:filesystem@0.2.0-rc-2023-11-10;
world imports {
import types;
diff --git a/wit/deps/io/error.wit b/wit/deps/io/error.wit
new file mode 100644
index 0000000..31918ac
--- /dev/null
+++ b/wit/deps/io/error.wit
@@ -0,0 +1,34 @@
+package wasi:io@0.2.0-rc-2023-11-10;
+
+
+interface 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
+ /// provide functions to further "downcast" this error into more specific
+ /// error information. For example, `error`s returned in streams derived
+ /// from filesystem types to be described using the filesystem's own
+ /// error-code type, using the function
+ /// `wasi:filesystem/types/filesystem-error-code`, which takes a parameter
+ /// `borrow` and returns
+ /// `option`.
+ ///
+ /// The set of functions which can "downcast" an `error` into a more
+ /// concrete type is open.
+ resource error {
+ /// 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.
+ to-debug-string: func() -> string;
+ }
+}
diff --git a/wit/deps/io/poll.wit b/wit/deps/io/poll.wit
index 0829a7d..bddde3c 100644
--- a/wit/deps/io/poll.wit
+++ b/wit/deps/io/poll.wit
@@ -1,4 +1,4 @@
-package wasi:io;
+package wasi:io@0.2.0-rc-2023-11-10;
/// 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 8999b28..e7e1b68 100644
--- a/wit/deps/io/streams.wit
+++ b/wit/deps/io/streams.wit
@@ -1,4 +1,4 @@
-package wasi:io;
+package wasi:io@0.2.0-rc-2023-11-10;
/// WASI I/O is an I/O abstraction API which is currently focused on providing
/// stream types.
@@ -6,6 +6,7 @@ package wasi:io;
/// In the future, the component model is expected to add built-in stream types;
/// when it does, they are expected to subsume this API.
interface streams {
+ use error.{error};
use poll.{pollable};
/// An error for input-stream and output-stream operations.
@@ -20,26 +21,6 @@ interface streams {
closed
}
- /// Contextual error information about the last failure that happened on
- /// a read, write, or flush from an `input-stream` or `output-stream`.
- ///
- /// This type is returned through the `stream-error` type whenever an
- /// operation on a stream directly fails or an error is discovered
- /// after-the-fact, for example when a write's failure shows up through a
- /// later `flush` or `check-write`.
- ///
- /// Interfaces such as `wasi:filesystem/types` provide functionality to
- /// further "downcast" this error into interface-specific error information.
- resource error {
- /// Returns a string that's suitable to assist humans in debugging this
- /// error.
- ///
- /// The returned string will change across platforms and hosts which
- /// means that parsing it, for example, would be a
- /// platform-compatibility hazard.
- to-debug-string: func() -> string;
- }
-
/// An input bytestream.
///
/// `input-stream`s are *non-blocking* to the extent practical on underlying
diff --git a/wit/deps/io/world.wit b/wit/deps/io/world.wit
index 05244a9..8243da2 100644
--- a/wit/deps/io/world.wit
+++ b/wit/deps/io/world.wit
@@ -1,4 +1,4 @@
-package wasi:io;
+package wasi:io@0.2.0-rc-2023-11-10;
world imports {
import streams;
diff --git a/wit/deps/random/insecure-seed.wit b/wit/deps/random/insecure-seed.wit
index 139aed1..f76e87d 100644
--- a/wit/deps/random/insecure-seed.wit
+++ b/wit/deps/random/insecure-seed.wit
@@ -1,3 +1,4 @@
+package wasi:random@0.2.0-rc-2023-11-10;
/// The insecure-seed interface for seeding hash-map DoS resistance.
///
/// It is intended to be portable at least between Unix-family platforms and
diff --git a/wit/deps/random/insecure.wit b/wit/deps/random/insecure.wit
index 2ffd223..ec7b997 100644
--- a/wit/deps/random/insecure.wit
+++ b/wit/deps/random/insecure.wit
@@ -1,3 +1,4 @@
+package wasi:random@0.2.0-rc-2023-11-10;
/// The insecure interface for insecure pseudo-random numbers.
///
/// It is intended to be portable at least between Unix-family platforms and
diff --git a/wit/deps/random/random.wit b/wit/deps/random/random.wit
index 2c3c6a8..7a7dfa2 100644
--- a/wit/deps/random/random.wit
+++ b/wit/deps/random/random.wit
@@ -1,3 +1,4 @@
+package wasi:random@0.2.0-rc-2023-11-10;
/// WASI Random is a random data API.
///
/// It is intended to be portable at least between Unix-family platforms and
diff --git a/wit/deps/random/world.wit b/wit/deps/random/world.wit
index bb1dd7b..49e5743 100644
--- a/wit/deps/random/world.wit
+++ b/wit/deps/random/world.wit
@@ -1,4 +1,4 @@
-package wasi:random;
+package wasi:random@0.2.0-rc-2023-11-10;
world imports {
import random;
diff --git a/wit/deps/sockets/instance-network.wit b/wit/deps/sockets/instance-network.wit
index 14e4479..e455d0f 100644
--- a/wit/deps/sockets/instance-network.wit
+++ b/wit/deps/sockets/instance-network.wit
@@ -1,9 +1,9 @@
/// This interface provides a value-export of the default network handle..
interface instance-network {
- use network.{network};
+ use network.{network};
- /// Get a handle to the default network.
- instance-network: func() -> network;
+ /// Get a handle to the default network.
+ instance-network: func() -> network;
}
diff --git a/wit/deps/sockets/ip-name-lookup.wit b/wit/deps/sockets/ip-name-lookup.wit
index b51fe05..931ccf7 100644
--- a/wit/deps/sockets/ip-name-lookup.wit
+++ b/wit/deps/sockets/ip-name-lookup.wit
@@ -1,61 +1,51 @@
interface ip-name-lookup {
- use wasi:io/poll.{pollable};
- use network.{network, error-code, ip-address, ip-address-family};
+ use wasi:io/poll@0.2.0-rc-2023-11-10.{pollable};
+ use network.{network, error-code, ip-address};
- /// Resolve an internet host name to a list of IP addresses.
- ///
- /// See the wasi-socket proposal README.md for a comparison with getaddrinfo.
- ///
- /// # Parameters
- /// - `name`: The name to look up. IP addresses are not allowed. Unicode domain names are automatically converted
- /// to ASCII using IDNA encoding.
- /// - `address-family`: If provided, limit the results to addresses of this specific address family.
- /// - `include-unavailable`: When set to true, this function will also return addresses of which the runtime
- /// thinks (or knows) can't be connected to at the moment. For example, this will return IPv6 addresses on
- /// systems without an active IPv6 interface. Notes:
- /// - Even when no public IPv6 interfaces are present or active, names like "localhost" can still resolve to an IPv6 address.
- /// - Whatever is "available" or "unavailable" is volatile and can change everytime a network cable is unplugged.
- ///
- /// This function never blocks. It either immediately fails or immediately returns successfully with a `resolve-address-stream`
- /// that can be used to (asynchronously) fetch the results.
- ///
- /// At the moment, the stream never completes successfully with 0 items. Ie. the first call
- /// to `resolve-next-address` never returns `ok(none)`. This may change in the future.
- ///
- /// # Typical errors
- /// - `invalid-name`: `name` is a syntactically invalid domain name.
- /// - `invalid-name`: `name` is an IP address.
- /// - `address-family-not-supported`: The specified `address-family` is not supported. (EAI_FAMILY)
- ///
- /// # References:
- /// -
- /// -
- /// -
- /// -
- resolve-addresses: func(network: borrow, name: string, address-family: option, include-unavailable: bool) -> result;
+ /// 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
+ /// as-is without making any external requests.
+ ///
+ /// See the wasi-socket proposal README.md for a comparison with getaddrinfo.
+ ///
+ /// This function never blocks. It either immediately fails or immediately
+ /// returns successfully with a `resolve-address-stream` that can be used
+ /// to (asynchronously) fetch the results.
+ ///
+ /// # Typical errors
+ /// - `invalid-argument`: `name` is a syntactically invalid domain name or IP address.
+ ///
+ /// # References:
+ /// -
+ /// -
+ /// -
+ /// -
+ resolve-addresses: func(network: borrow, name: string) -> result;
- resource resolve-address-stream {
- /// 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
- /// addresses have been exhausted, this function returns `none`.
- ///
- /// This function never returns IPv4-mapped IPv6 addresses.
- ///
- /// # Typical errors
- /// - `name-unresolvable`: Name does not exist or has no suitable associated IP addresses. (EAI_NONAME, EAI_NODATA, EAI_ADDRFAMILY)
- /// - `temporary-resolver-failure`: A temporary failure in name resolution occurred. (EAI_AGAIN)
- /// - `permanent-resolver-failure`: A permanent failure in name resolution occurred. (EAI_FAIL)
- /// - `would-block`: A result is not available yet. (EWOULDBLOCK, EAGAIN)
- resolve-next-address: func() -> result