diff --git a/wit-0.3.0-draft/deps.lock b/wit-0.3.0-draft/deps.lock index 07d5892..4f3b1fe 100644 --- a/wit-0.3.0-draft/deps.lock +++ b/wit-0.3.0-draft/deps.lock @@ -1,5 +1,5 @@ [clocks] url = "https://github.com/WebAssembly/wasi-clocks/archive/main.tar.gz" subdir = "wit-0.3.0-draft" -sha256 = "626953ec28ae956ec1233c4350deab6e5cdcbdd9ae6d491e102ad7c6901cc8bf" -sha512 = "ae375b002cfaacdbaa133bb87747d1b86675e13144067c3005d6c32cf5c37bb7a52b693ae46d5cd65fc4910a78d7255d0ada5142828a022497fd0eaacb61761f" +sha256 = "cf61a3785c2838340ce530ee1cdc6dbee3257f1672d6000ca748dfe253808dec" +sha512 = "f647de7d6c470595c3e5bf0dba6af98703beb9f701c66543cea5d42e81f7a1a73f199c3949035a9c2c1bd717056e5e68788f520af39b9d26480242b7626f22ce" diff --git a/wit-0.3.0-draft/deps/clocks/monotonic-clock.wit b/wit-0.3.0-draft/deps/clocks/monotonic-clock.wit index 0c58241..a91d495 100644 --- a/wit-0.3.0-draft/deps/clocks/monotonic-clock.wit +++ b/wit-0.3.0-draft/deps/clocks/monotonic-clock.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.3.0-rc-2025-08-15; +package wasi:clocks@0.3.0-rc-2025-09-16; /// WASI Monotonic Clock is a clock API intended to let users measure elapsed /// time. /// @@ -7,38 +7,41 @@ package wasi:clocks@0.3.0-rc-2025-08-15; /// /// A monotonic clock is a clock which has an unspecified initial value, and /// successive reads of the clock will produce non-decreasing values. -@since(version = 0.3.0-rc-2025-08-15) +@since(version = 0.3.0-rc-2025-09-16) interface monotonic-clock { + use types.{duration}; + /// 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. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) type instant = u64; - /// A duration of time, in nanoseconds. - @since(version = 0.3.0-rc-2025-08-15) - type duration = u64; - /// Read the current value of the clock. /// /// The clock is monotonic, therefore calling this function repeatedly will /// produce a sequence of non-decreasing values. - @since(version = 0.3.0-rc-2025-08-15) + /// + /// For completeness, this function traps if it's not possible to represent + /// the value of the clock in an `instant`. Consequently, implementations + /// should ensure that the starting time is low enough to avoid the + /// possibility of overflow in practice. + @since(version = 0.3.0-rc-2025-09-16) now: func() -> instant; /// Query the resolution of the clock. Returns the duration of time /// corresponding to a clock tick. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-resolution: func() -> duration; /// Wait until the specified instant has occurred. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) wait-until: async func( when: instant, ); - /// Wait for the specified duration has elapsed. - @since(version = 0.3.0-rc-2025-08-15) + /// Wait for the specified duration to elapse. + @since(version = 0.3.0-rc-2025-09-16) wait-for: async func( how-long: duration, ); diff --git a/wit-0.3.0-draft/deps/clocks/timezone.wit b/wit-0.3.0-draft/deps/clocks/timezone.wit index 2ee16ab..ab8f5c0 100644 --- a/wit-0.3.0-draft/deps/clocks/timezone.wit +++ b/wit-0.3.0-draft/deps/clocks/timezone.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.3.0-rc-2025-08-15; +package wasi:clocks@0.3.0-rc-2025-09-16; @unstable(feature = clocks-timezone) interface timezone { diff --git a/wit-0.3.0-draft/deps/clocks/types.wit b/wit-0.3.0-draft/deps/clocks/types.wit new file mode 100644 index 0000000..aff7c2a --- /dev/null +++ b/wit-0.3.0-draft/deps/clocks/types.wit @@ -0,0 +1,8 @@ +package wasi:clocks@0.3.0-rc-2025-09-16; +/// This interface common types used throughout wasi:clocks. +@since(version = 0.3.0-rc-2025-09-16) +interface types { + /// A duration of time, in nanoseconds. + @since(version = 0.3.0-rc-2025-09-16) + type duration = u64; +} diff --git a/wit-0.3.0-draft/deps/clocks/wall-clock.wit b/wit-0.3.0-draft/deps/clocks/wall-clock.wit index 2e3b2d4..ea94050 100644 --- a/wit-0.3.0-draft/deps/clocks/wall-clock.wit +++ b/wit-0.3.0-draft/deps/clocks/wall-clock.wit @@ -1,4 +1,4 @@ -package wasi:clocks@0.3.0-rc-2025-08-15; +package wasi:clocks@0.3.0-rc-2025-09-16; /// 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. @@ -13,10 +13,10 @@ package wasi:clocks@0.3.0-rc-2025-08-15; /// monotonic, making it unsuitable for measuring elapsed time. /// /// It is intended for reporting the current date and time for humans. -@since(version = 0.3.0-rc-2025-08-15) +@since(version = 0.3.0-rc-2025-09-16) interface wall-clock { /// A time and date in seconds plus nanoseconds. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) record datetime { seconds: u64, nanoseconds: u32, @@ -35,12 +35,12 @@ interface wall-clock { /// /// [POSIX's Seconds Since the Epoch]: https://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap04.html#tag_21_04_16 /// [Unix Time]: https://en.wikipedia.org/wiki/Unix_time - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) now: func() -> datetime; /// Query the resolution of the clock. /// /// The nanoseconds field of the output is always less than 1000000000. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-resolution: func() -> datetime; } diff --git a/wit-0.3.0-draft/deps/clocks/world.wit b/wit-0.3.0-draft/deps/clocks/world.wit index 94068c7..a6b885f 100644 --- a/wit-0.3.0-draft/deps/clocks/world.wit +++ b/wit-0.3.0-draft/deps/clocks/world.wit @@ -1,10 +1,10 @@ -package wasi:clocks@0.3.0-rc-2025-08-15; +package wasi:clocks@0.3.0-rc-2025-09-16; -@since(version = 0.3.0-rc-2025-08-15) +@since(version = 0.3.0-rc-2025-09-16) world imports { - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) import monotonic-clock; - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) import wall-clock; @unstable(feature = clocks-timezone) import timezone; diff --git a/wit-0.3.0-draft/ip-name-lookup.wit b/wit-0.3.0-draft/ip-name-lookup.wit index ab4156e..6a652ff 100644 --- a/wit-0.3.0-draft/ip-name-lookup.wit +++ b/wit-0.3.0-draft/ip-name-lookup.wit @@ -1,10 +1,10 @@ -@since(version = 0.3.0-rc-2025-08-15) +@since(version = 0.3.0-rc-2025-09-16) interface ip-name-lookup { - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) use types.{ip-address}; /// Lookup error codes. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) enum error-code { /// Unknown error unknown, @@ -57,6 +57,6 @@ interface ip-name-lookup { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) resolve-addresses: async func(name: string) -> result, error-code>; } diff --git a/wit-0.3.0-draft/types.wit b/wit-0.3.0-draft/types.wit index 3a7915c..2ed1912 100644 --- a/wit-0.3.0-draft/types.wit +++ b/wit-0.3.0-draft/types.wit @@ -1,7 +1,7 @@ -@since(version = 0.3.0-rc-2025-08-15) +@since(version = 0.3.0-rc-2025-09-16) interface types { - @since(version = 0.3.0-rc-2025-08-15) - use wasi:clocks/monotonic-clock@0.3.0-rc-2025-08-15.{duration}; + @since(version = 0.3.0-rc-2025-09-16) + use wasi:clocks/monotonic-clock@0.3.0-rc-2025-09-16.{duration}; /// Error codes. /// @@ -14,7 +14,7 @@ interface types { /// - `out-of-memory` /// /// See each individual API for what the POSIX equivalents are. They sometimes differ per API. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) enum error-code { /// Unknown error unknown, @@ -70,7 +70,7 @@ interface types { datagram-too-large, } - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) enum ip-address-family { /// Similar to `AF_INET` in POSIX. ipv4, @@ -79,18 +79,18 @@ interface types { ipv6, } - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) type ipv4-address = tuple; - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) type ipv6-address = tuple; - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) variant ip-address { ipv4(ipv4-address), ipv6(ipv6-address), } - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) record ipv4-socket-address { /// sin_port port: u16, @@ -98,7 +98,7 @@ interface types { address: ipv4-address, } - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) record ipv6-socket-address { /// sin6_port port: u16, @@ -110,7 +110,7 @@ interface types { scope-id: u32, } - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) variant ip-socket-address { ipv4(ipv4-socket-address), ipv6(ipv6-socket-address), @@ -135,7 +135,7 @@ interface types { /// In addition to the general error codes documented on the /// `types::error-code` type, TCP socket methods may always return /// `error(invalid-state)` when in the `closed` state. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) resource tcp-socket { /// Create a new TCP socket. @@ -152,7 +152,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) create: static func(address-family: ip-address-family) -> result; /// Bind the socket to the provided IP address and port. @@ -186,7 +186,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) bind: func(local-address: ip-socket-address) -> result<_, error-code>; /// Connect to a remote endpoint. @@ -218,7 +218,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) connect: async func(remote-address: ip-socket-address) -> result<_, error-code>; /// Start listening and return a stream of new inbound connections. @@ -285,7 +285,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) listen: func() -> result, error-code>; /// Transmit data to peer. @@ -308,7 +308,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) send: async func(data: stream) -> result<_, error-code>; /// Read data from peer. @@ -342,7 +342,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) receive: func() -> tuple, future>>; /// Get the bound local address. @@ -361,7 +361,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-local-address: func() -> result; /// Get the remote address. @@ -374,13 +374,13 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-remote-address: func() -> result; /// Whether the socket is in the `listening` state. /// /// Equivalent to the SO_ACCEPTCONN socket option. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-is-listening: func() -> bool; /// Whether this is a IPv4 or IPv6 socket. @@ -388,7 +388,7 @@ interface types { /// This is the value passed to the constructor. /// /// Equivalent to the SO_DOMAIN socket option. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-address-family: func() -> ip-address-family; /// Hints the desired listen queue size. Implementations are free to ignore this. @@ -400,7 +400,7 @@ interface types { /// - `not-supported`: (set) The platform does not support changing the backlog size after the initial listen. /// - `invalid-argument`: (set) The provided value was 0. /// - `invalid-state`: (set) The socket is in the `connecting` or `connected` state. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) set-listen-backlog-size: func(value: u64) -> result<_, error-code>; /// Enables or disables keepalive. @@ -412,9 +412,9 @@ interface types { /// These properties can be configured while `keep-alive-enabled` is false, but only come into effect when `keep-alive-enabled` is true. /// /// Equivalent to the SO_KEEPALIVE socket option. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-keep-alive-enabled: func() -> result; - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) set-keep-alive-enabled: func(value: bool) -> result<_, error-code>; /// Amount of time the connection has to be idle before TCP starts sending keepalive packets. @@ -427,9 +427,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-keep-alive-idle-time: func() -> result; - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) set-keep-alive-idle-time: func(value: duration) -> result<_, error-code>; /// The time between keepalive packets. @@ -442,9 +442,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-keep-alive-interval: func() -> result; - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) set-keep-alive-interval: func(value: duration) -> result<_, error-code>; /// The maximum amount of keepalive packets TCP should send before aborting the connection. @@ -457,9 +457,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-keep-alive-count: func() -> result; - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) set-keep-alive-count: func(value: u32) -> result<_, error-code>; /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. @@ -468,9 +468,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The TTL value must be 1 or higher. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-hop-limit: func() -> result; - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) set-hop-limit: func(value: u8) -> result<_, error-code>; /// The kernel buffer space reserved for sends/receives on this socket. @@ -483,18 +483,18 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-receive-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-send-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) set-send-buffer-size: func(value: u64) -> result<_, error-code>; } /// A UDP socket handle. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) resource udp-socket { /// Create a new UDP socket. @@ -511,7 +511,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) create: static func(address-family: ip-address-family) -> result; /// Bind the socket to the provided IP address and port. @@ -532,7 +532,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) bind: func(local-address: ip-socket-address) -> result<_, error-code>; /// Associate this socket with a specific peer address. @@ -571,7 +571,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) connect: func(remote-address: ip-socket-address) -> result<_, error-code>; /// Dissociate this socket from its peer address. @@ -589,7 +589,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) disconnect: func() -> result<_, error-code>; /// Send a message on the socket to a particular peer. @@ -623,7 +623,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) send: async func(data: list, remote-address: option) -> result<_, error-code>; /// Receive a message on the socket. @@ -649,7 +649,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) receive: async func() -> result, ip-socket-address>, error-code>; /// Get the current bound address. @@ -668,7 +668,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-local-address: func() -> result; /// Get the address the socket is currently "connected" to. @@ -681,7 +681,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-remote-address: func() -> result; /// Whether this is a IPv4 or IPv6 socket. @@ -689,7 +689,7 @@ interface types { /// This is the value passed to the constructor. /// /// Equivalent to the SO_DOMAIN socket option. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-address-family: func() -> ip-address-family; /// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. @@ -698,9 +698,9 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The TTL value must be 1 or higher. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-unicast-hop-limit: func() -> result; - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) set-unicast-hop-limit: func(value: u8) -> result<_, error-code>; /// The kernel buffer space reserved for sends/receives on this socket. @@ -713,13 +713,13 @@ interface types { /// /// # Typical errors /// - `invalid-argument`: (set) The provided value was 0. - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-receive-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) get-send-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) set-send-buffer-size: func(value: u64) -> result<_, error-code>; } } diff --git a/wit-0.3.0-draft/world.wit b/wit-0.3.0-draft/world.wit index dfafac2..44cc427 100644 --- a/wit-0.3.0-draft/world.wit +++ b/wit-0.3.0-draft/world.wit @@ -1,9 +1,9 @@ -package wasi:sockets@0.3.0-rc-2025-08-15; +package wasi:sockets@0.3.0-rc-2025-09-16; -@since(version = 0.3.0-rc-2025-08-15) +@since(version = 0.3.0-rc-2025-09-16) world imports { - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) import types; - @since(version = 0.3.0-rc-2025-08-15) + @since(version = 0.3.0-rc-2025-09-16) import ip-name-lookup; }