diff --git a/wit-0.3.0-draft/deps.lock b/wit-0.3.0-draft/deps.lock index 5a36003..07d5892 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 = "d0257e056a4061eaab58a934d84b4b35534d90866667054e886da65c170aeef6" -sha512 = "b033cd0171d9d0c908b17f98f792e47eaeee7534d4bca664c62bdab6f48a8046179e068d4ef11d1e333d3ca44777691b14293eb955e88fda701bdcf90637efae" +sha256 = "626953ec28ae956ec1233c4350deab6e5cdcbdd9ae6d491e102ad7c6901cc8bf" +sha512 = "ae375b002cfaacdbaa133bb87747d1b86675e13144067c3005d6c32cf5c37bb7a52b693ae46d5cd65fc4910a78d7255d0ada5142828a022497fd0eaacb61761f" 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 4464d29..0c58241 100644 --- a/wit-0.3.0-draft/deps/clocks/monotonic-clock.wit +++ b/wit-0.3.0-draft/deps/clocks/monotonic-clock.wit @@ -9,23 +9,20 @@ package wasi:clocks@0.3.0-rc-2025-08-15; /// successive reads of the clock will produce non-decreasing values. @since(version = 0.3.0-rc-2025-08-15) 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) 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. - /// - /// 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-08-15) now: func() -> instant; @@ -40,7 +37,7 @@ interface monotonic-clock { when: instant, ); - /// Wait for the specified duration to elapse. + /// Wait for the specified duration has elapsed. @since(version = 0.3.0-rc-2025-08-15) wait-for: async func( how-long: duration, diff --git a/wit-0.3.0-draft/deps/clocks/types.wit b/wit-0.3.0-draft/deps/clocks/types.wit deleted file mode 100644 index 4736b89..0000000 --- a/wit-0.3.0-draft/deps/clocks/types.wit +++ /dev/null @@ -1,8 +0,0 @@ -package wasi:clocks@0.3.0-rc-2025-08-15; -/// This interface common types used throughout wasi:clocks. -@since(version = 0.3.0-rc-2025-08-15) -interface types { - /// A duration of time, in nanoseconds. - @since(version = 0.3.0-rc-2025-08-15) - type duration = u64; -} diff --git a/wit-0.3.0-draft/ip-name-lookup.wit b/wit-0.3.0-draft/ip-name-lookup.wit index 6a652ff..ab4156e 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-09-16) +@since(version = 0.3.0-rc-2025-08-15) interface ip-name-lookup { - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) use types.{ip-address}; /// Lookup error codes. - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) enum error-code { /// Unknown error unknown, @@ -57,6 +57,6 @@ interface ip-name-lookup { /// - /// - /// - - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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 2ed1912..3a7915c 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-09-16) +@since(version = 0.3.0-rc-2025-08-15) interface types { - @since(version = 0.3.0-rc-2025-09-16) - use wasi:clocks/monotonic-clock@0.3.0-rc-2025-09-16.{duration}; + @since(version = 0.3.0-rc-2025-08-15) + use wasi:clocks/monotonic-clock@0.3.0-rc-2025-08-15.{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-09-16) + @since(version = 0.3.0-rc-2025-08-15) enum error-code { /// Unknown error unknown, @@ -70,7 +70,7 @@ interface types { datagram-too-large, } - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) type ipv4-address = tuple; - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) type ipv6-address = tuple; - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) variant ip-address { ipv4(ipv4-address), ipv6(ipv6-address), } - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) record ipv4-socket-address { /// sin_port port: u16, @@ -98,7 +98,7 @@ interface types { address: ipv4-address, } - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) record ipv6-socket-address { /// sin6_port port: u16, @@ -110,7 +110,7 @@ interface types { scope-id: u32, } - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) resource tcp-socket { /// Create a new TCP socket. @@ -152,7 +152,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) listen: func() -> result, error-code>; /// Transmit data to peer. @@ -308,7 +308,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) receive: func() -> tuple, future>>; /// Get the bound local address. @@ -361,7 +361,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) get-local-address: func() -> result; /// Get the remote address. @@ -374,13 +374,13 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) get-keep-alive-enabled: func() -> result; - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) get-keep-alive-idle-time: func() -> result; - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) get-keep-alive-interval: func() -> result; - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) get-keep-alive-count: func() -> result; - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) get-hop-limit: func() -> result; - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) get-receive-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) get-send-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) set-send-buffer-size: func(value: u64) -> result<_, error-code>; } /// A UDP socket handle. - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) resource udp-socket { /// Create a new UDP socket. @@ -511,7 +511,7 @@ interface types { /// - /// - /// - - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) get-unicast-hop-limit: func() -> result; - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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-09-16) + @since(version = 0.3.0-rc-2025-08-15) get-receive-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) set-receive-buffer-size: func(value: u64) -> result<_, error-code>; - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) get-send-buffer-size: func() -> result; - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) 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 44cc427..dfafac2 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-09-16; +package wasi:sockets@0.3.0-rc-2025-08-15; -@since(version = 0.3.0-rc-2025-09-16) +@since(version = 0.3.0-rc-2025-08-15) world imports { - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) import types; - @since(version = 0.3.0-rc-2025-09-16) + @since(version = 0.3.0-rc-2025-08-15) import ip-name-lookup; }