Skip to content

Commit

Permalink
Update to v0.2.2 (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshuawuyts authored Oct 3, 2024
1 parent f9a4a57 commit 110b161
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 62 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
./wit-deps lock
git add -N wit/deps
git diff --exit-code
- uses: WebAssembly/wit-abi-up-to-date@v21
- uses: WebAssembly/wit-abi-up-to-date@v22
with:
features: clocks-timezone
wit-bindgen: '0.28.0'
wit-bindgen: '0.33.0'
98 changes: 49 additions & 49 deletions imports.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
<h1><a name="imports">World imports</a></h1>
<h1><a id="imports"></a>World imports</h1>
<ul>
<li>Imports:
<ul>
<li>interface <a href="#wasi_io_poll_0_2_1"><code>wasi:io/[email protected].1</code></a></li>
<li>interface <a href="#wasi_clocks_monotonic_clock_0_2_1"><code>wasi:clocks/[email protected].1</code></a></li>
<li>interface <a href="#wasi_clocks_wall_clock_0_2_1"><code>wasi:clocks/[email protected].1</code></a></li>
<li>interface <a href="#wasi_clocks_timezone_0_2_1"><code>wasi:clocks/[email protected].1</code></a></li>
<li>interface <a href="#wasi_io_poll_0_2_2"><code>wasi:io/[email protected].2</code></a></li>
<li>interface <a href="#wasi_clocks_monotonic_clock_0_2_2"><code>wasi:clocks/[email protected].2</code></a></li>
<li>interface <a href="#wasi_clocks_wall_clock_0_2_2"><code>wasi:clocks/[email protected].2</code></a></li>
<li>interface <a href="#wasi_clocks_timezone_0_2_2"><code>wasi:clocks/[email protected].2</code></a></li>
</ul>
</li>
</ul>
<h2><a name="wasi_io_poll_0_2_1"></a>Import interface wasi:io/[email protected].1</h2>
<h2><a id="wasi_io_poll_0_2_2"></a>Import interface wasi:io/[email protected].2</h2>
<p>A poll API intended to let users wait for I/O events on multiple handles
at once.</p>
<hr />
<h3>Types</h3>
<h4><a name="pollable"></a><code>resource pollable</code></h4>
<h4><a id="pollable"></a><code>resource pollable</code></h4>
<h2><a href="#pollable"><code>pollable</code></a> represents a single I/O event which may be ready, or not.</h2>
<h3>Functions</h3>
<h4><a name="method_pollable_ready"></a><code>[method]pollable.ready: func</code></h4>
<h4><a id="method_pollable_ready"></a><code>[method]pollable.ready: func</code></h4>
<p>Return the readiness of a pollable. This function never blocks.</p>
<p>Returns <code>true</code> when the pollable is ready, and <code>false</code> otherwise.</p>
<h5>Params</h5>
<ul>
<li><a name="method_pollable_ready.self"></a><code>self</code>: borrow&lt;<a href="#pollable"><a href="#pollable"><code>pollable</code></a></a>&gt;</li>
<li><a id="method_pollable_ready.self"></a><code>self</code>: borrow&lt;<a href="#pollable"><a href="#pollable"><code>pollable</code></a></a>&gt;</li>
</ul>
<h5>Return values</h5>
<ul>
<li><a name="method_pollable_ready.0"></a> <code>bool</code></li>
<li><a id="method_pollable_ready.0"></a> <code>bool</code></li>
</ul>
<h4><a name="method_pollable_block"></a><code>[method]pollable.block: func</code></h4>
<h4><a id="method_pollable_block"></a><code>[method]pollable.block: func</code></h4>
<p><code>block</code> returns immediately if the pollable is ready, and otherwise
blocks until ready.</p>
<p>This function is equivalent to calling <code>poll.poll</code> on a list
containing only this pollable.</p>
<h5>Params</h5>
<ul>
<li><a name="method_pollable_block.self"></a><code>self</code>: borrow&lt;<a href="#pollable"><a href="#pollable"><code>pollable</code></a></a>&gt;</li>
<li><a id="method_pollable_block.self"></a><code>self</code>: borrow&lt;<a href="#pollable"><a href="#pollable"><code>pollable</code></a></a>&gt;</li>
</ul>
<h4><a name="poll"></a><code>poll: func</code></h4>
<h4><a id="poll"></a><code>poll: func</code></h4>
<p>Poll for completion on a set of pollables.</p>
<p>This function takes a list of pollables, which identify I/O sources of
interest, and waits until one or more of the events is ready for I/O.</p>
Expand All @@ -56,13 +56,13 @@ the pollables has an error, it is indicated by marking the source as
being ready for I/O.</p>
<h5>Params</h5>
<ul>
<li><a name="poll.in"></a><code>in</code>: list&lt;borrow&lt;<a href="#pollable"><a href="#pollable"><code>pollable</code></a></a>&gt;&gt;</li>
<li><a id="poll.in"></a><code>in</code>: list&lt;borrow&lt;<a href="#pollable"><a href="#pollable"><code>pollable</code></a></a>&gt;&gt;</li>
</ul>
<h5>Return values</h5>
<ul>
<li><a name="poll.0"></a> list&lt;<code>u32</code>&gt;</li>
<li><a id="poll.0"></a> list&lt;<code>u32</code>&gt;</li>
</ul>
<h2><a name="wasi_clocks_monotonic_clock_0_2_1"></a>Import interface wasi:clocks/[email protected].1</h2>
<h2><a id="wasi_clocks_monotonic_clock_0_2_2"></a>Import interface wasi:clocks/[email protected].2</h2>
<p>WASI Monotonic Clock is a clock API intended to let users measure elapsed
time.</p>
<p>It is intended to be portable at least between Unix-family platforms and
Expand All @@ -71,57 +71,57 @@ Windows.</p>
successive reads of the clock will produce non-decreasing values.</p>
<hr />
<h3>Types</h3>
<h4><a name="pollable"></a><code>type pollable</code></h4>
<h4><a id="pollable"></a><code>type pollable</code></h4>
<p><a href="#pollable"><a href="#pollable"><code>pollable</code></a></a></p>
<p>
#### <a name="instant"></a>`type instant`
#### <a id="instant"></a>`type instant`
`u64`
<p>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.
<h4><a name="duration"></a><code>type duration</code></h4>
<h4><a id="duration"></a><code>type duration</code></h4>
<p><code>u64</code></p>
<p>A duration of time, in nanoseconds.
<hr />
<h3>Functions</h3>
<h4><a name="now"></a><code>now: func</code></h4>
<h4><a id="now"></a><code>now: func</code></h4>
<p>Read the current value of the clock.</p>
<p>The clock is monotonic, therefore calling this function repeatedly will
produce a sequence of non-decreasing values.</p>
<h5>Return values</h5>
<ul>
<li><a name="now.0"></a> <a href="#instant"><a href="#instant"><code>instant</code></a></a></li>
<li><a id="now.0"></a> <a href="#instant"><a href="#instant"><code>instant</code></a></a></li>
</ul>
<h4><a name="resolution"></a><code>resolution: func</code></h4>
<h4><a id="resolution"></a><code>resolution: func</code></h4>
<p>Query the resolution of the clock. Returns the duration of time
corresponding to a clock tick.</p>
<h5>Return values</h5>
<ul>
<li><a name="resolution.0"></a> <a href="#duration"><a href="#duration"><code>duration</code></a></a></li>
<li><a id="resolution.0"></a> <a href="#duration"><a href="#duration"><code>duration</code></a></a></li>
</ul>
<h4><a name="subscribe_instant"></a><code>subscribe-instant: func</code></h4>
<h4><a id="subscribe_instant"></a><code>subscribe-instant: func</code></h4>
<p>Create a <a href="#pollable"><code>pollable</code></a> which will resolve once the specified instant
has occurred.</p>
<h5>Params</h5>
<ul>
<li><a name="subscribe_instant.when"></a><code>when</code>: <a href="#instant"><a href="#instant"><code>instant</code></a></a></li>
<li><a id="subscribe_instant.when"></a><code>when</code>: <a href="#instant"><a href="#instant"><code>instant</code></a></a></li>
</ul>
<h5>Return values</h5>
<ul>
<li><a name="subscribe_instant.0"></a> own&lt;<a href="#pollable"><a href="#pollable"><code>pollable</code></a></a>&gt;</li>
<li><a id="subscribe_instant.0"></a> own&lt;<a href="#pollable"><a href="#pollable"><code>pollable</code></a></a>&gt;</li>
</ul>
<h4><a name="subscribe_duration"></a><code>subscribe-duration: func</code></h4>
<h4><a id="subscribe_duration"></a><code>subscribe-duration: func</code></h4>
<p>Create a <a href="#pollable"><code>pollable</code></a> that will resolve after the specified duration has
elapsed from the time this function is invoked.</p>
<h5>Params</h5>
<ul>
<li><a name="subscribe_duration.when"></a><code>when</code>: <a href="#duration"><a href="#duration"><code>duration</code></a></a></li>
<li><a id="subscribe_duration.when"></a><code>when</code>: <a href="#duration"><a href="#duration"><code>duration</code></a></a></li>
</ul>
<h5>Return values</h5>
<ul>
<li><a name="subscribe_duration.0"></a> own&lt;<a href="#pollable"><a href="#pollable"><code>pollable</code></a></a>&gt;</li>
<li><a id="subscribe_duration.0"></a> own&lt;<a href="#pollable"><a href="#pollable"><code>pollable</code></a></a>&gt;</li>
</ul>
<h2><a name="wasi_clocks_wall_clock_0_2_1"></a>Import interface wasi:clocks/[email protected].1</h2>
<h2><a id="wasi_clocks_wall_clock_0_2_2"></a>Import interface wasi:clocks/[email protected].2</h2>
<p>WASI Wall Clock is a clock API intended to let users query the current
time. The name &quot;wall&quot; makes an analogy to a &quot;clock on the wall&quot;, which
is not necessarily monotonic as it may be reset.</p>
Expand All @@ -134,16 +134,16 @@ monotonic, making it unsuitable for measuring elapsed time.</p>
<p>It is intended for reporting the current date and time for humans.</p>
<hr />
<h3>Types</h3>
<h4><a name="datetime"></a><code>record datetime</code></h4>
<h4><a id="datetime"></a><code>record datetime</code></h4>
<p>A time and date in seconds plus nanoseconds.</p>
<h5>Record Fields</h5>
<ul>
<li><a name="datetime.seconds"></a><code>seconds</code>: <code>u64</code></li>
<li><a name="datetime.nanoseconds"></a><code>nanoseconds</code>: <code>u32</code></li>
<li><a id="datetime.seconds"></a><code>seconds</code>: <code>u64</code></li>
<li><a id="datetime.nanoseconds"></a><code>nanoseconds</code>: <code>u32</code></li>
</ul>
<hr />
<h3>Functions</h3>
<h4><a name="now"></a><code>now: func</code></h4>
<h4><a id="now"></a><code>now: func</code></h4>
<p>Read the current value of the clock.</p>
<p>This clock is not monotonic, therefore calling this function repeatedly
will not necessarily produce a sequence of non-decreasing values.</p>
Expand All @@ -153,29 +153,29 @@ also known as <a href="https://en.wikipedia.org/wiki/Unix_time">Unix Time</a>.</
<p>The nanoseconds field of the output is always less than 1000000000.</p>
<h5>Return values</h5>
<ul>
<li><a name="now.0"></a> <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></li>
<li><a id="now.0"></a> <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></li>
</ul>
<h4><a name="resolution"></a><code>resolution: func</code></h4>
<h4><a id="resolution"></a><code>resolution: func</code></h4>
<p>Query the resolution of the clock.</p>
<p>The nanoseconds field of the output is always less than 1000000000.</p>
<h5>Return values</h5>
<ul>
<li><a name="resolution.0"></a> <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></li>
<li><a id="resolution.0"></a> <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></li>
</ul>
<h2><a name="wasi_clocks_timezone_0_2_1"></a>Import interface wasi:clocks/[email protected].1</h2>
<h2><a id="wasi_clocks_timezone_0_2_2"></a>Import interface wasi:clocks/[email protected].2</h2>
<hr />
<h3>Types</h3>
<h4><a name="datetime"></a><code>type datetime</code></h4>
<h4><a id="datetime"></a><code>type datetime</code></h4>
<p><a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></p>
<p>
#### <a name="timezone_display"></a>`record timezone-display`
#### <a id="timezone_display"></a>`record timezone-display`
<p>Information useful for displaying the timezone of a specific <a href="#datetime"><code>datetime</code></a>.</p>
<p>This information may vary within a single <code>timezone</code> to reflect daylight
saving time adjustments.</p>
<h5>Record Fields</h5>
<ul>
<li>
<p><a name="timezone_display.utc_offset"></a><a href="#utc_offset"><code>utc-offset</code></a>: <code>s32</code></p>
<p><a id="timezone_display.utc_offset"></a><a href="#utc_offset"><code>utc-offset</code></a>: <code>s32</code></p>
<p>The number of seconds difference between UTC time and the local
time of the timezone.
<p>The returned value will always be less than 86400 which is the
Expand All @@ -184,7 +184,7 @@ number of seconds in a day (24<em>60</em>60).</p>
should return 0.</p>
</li>
<li>
<p><a name="timezone_display.name"></a><code>name</code>: <code>string</code></p>
<p><a id="timezone_display.name"></a><code>name</code>: <code>string</code></p>
<p>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.
Expand All @@ -194,15 +194,15 @@ should be the string <code>UTC</code>.</p>
representation of the UTC offset may be returned, such as <code>-04:00</code>.</p>
</li>
<li>
<p><a name="timezone_display.in_daylight_saving_time"></a><code>in-daylight-saving-time</code>: <code>bool</code></p>
<p><a id="timezone_display.in_daylight_saving_time"></a><code>in-daylight-saving-time</code>: <code>bool</code></p>
<p>Whether daylight saving time is active.
<p>In implementations that do not expose an actual time zone, this
should return false.</p>
</li>
</ul>
<hr />
<h3>Functions</h3>
<h4><a name="display"></a><code>display: func</code></h4>
<h4><a id="display"></a><code>display: func</code></h4>
<p>Return information needed to display the given <a href="#datetime"><code>datetime</code></a>. This includes
the UTC offset, the time zone name, and a flag indicating whether
daylight saving time is active.</p>
Expand All @@ -211,19 +211,19 @@ daylight saving time is active.</p>
saving time.</p>
<h5>Params</h5>
<ul>
<li><a name="display.when"></a><code>when</code>: <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></li>
<li><a id="display.when"></a><code>when</code>: <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></li>
</ul>
<h5>Return values</h5>
<ul>
<li><a name="display.0"></a> <a href="#timezone_display"><a href="#timezone_display"><code>timezone-display</code></a></a></li>
<li><a id="display.0"></a> <a href="#timezone_display"><a href="#timezone_display"><code>timezone-display</code></a></a></li>
</ul>
<h4><a name="utc_offset"></a><code>utc-offset: func</code></h4>
<h4><a id="utc_offset"></a><code>utc-offset: func</code></h4>
<p>The same as <a href="#display"><code>display</code></a>, but only return the UTC offset.</p>
<h5>Params</h5>
<ul>
<li><a name="utc_offset.when"></a><code>when</code>: <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></li>
<li><a id="utc_offset.when"></a><code>when</code>: <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></li>
</ul>
<h5>Return values</h5>
<ul>
<li><a name="utc_offset.0"></a> <code>s32</code></li>
<li><a id="utc_offset.0"></a> <code>s32</code></li>
</ul>
4 changes: 2 additions & 2 deletions wit/deps.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[io]
url = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
sha256 = "2a74bd811adc46b5a0f19827ddbde89870e52b17615f4d0873f06fd977250caf"
sha512 = "94624f00c66e66203592cee820f80b1ba91ecdb71f682c154f25eaf71f8d8954197dcb64503bc21e72ed5e812af7eae876df47b7eb727b02db3a74a7ce0aefca"
sha256 = "6d8dbfaaaa685167c1829616dc7265f5f3cb776845879555612d56544f6d9bfc"
sha512 = "52219562c4183503169cd2947b8164e1c96974500a5adf15bbf382c5992a10a626cc89c3b319204aeda6698ce59cbca2c42f98f7fde296aa77b9db4b41154dbe"
2 changes: 1 addition & 1 deletion wit/deps/io/error.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:io@0.2.1;
package wasi:io@0.2.2;

@since(version = 0.2.0)
interface error {
Expand Down
2 changes: 1 addition & 1 deletion wit/deps/io/poll.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:io@0.2.1;
package wasi:io@0.2.2;

/// A poll API intended to let users wait for I/O events on multiple handles
/// at once.
Expand Down
6 changes: 5 additions & 1 deletion wit/deps/io/streams.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:io@0.2.1;
package wasi:io@0.2.2;

/// WASI I/O is an I/O abstraction API which is currently focused on providing
/// stream types.
Expand All @@ -18,6 +18,9 @@ interface streams {
/// The last operation (a write or flush) failed before completion.
///
/// More information is available in the `error` payload.
///
/// After this, the stream will be closed. All future operations return
/// `stream-error::closed`.
last-operation-failed(error),
/// The stream is closed: no more input will be accepted by the
/// stream. A closed output-stream will return this error on all
Expand Down Expand Up @@ -205,6 +208,7 @@ interface streams {
/// The created `pollable` is a child resource of the `output-stream`.
/// Implementations may trap if the `output-stream` is dropped before
/// all derived `pollable`s created with this function are dropped.
@since(version = 0.2.0)
subscribe: func() -> pollable;

/// Write zeroes to a stream.
Expand Down
2 changes: 1 addition & 1 deletion wit/deps/io/world.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:io@0.2.1;
package wasi:io@0.2.2;

@since(version = 0.2.0)
world imports {
Expand Down
4 changes: 2 additions & 2 deletions wit/monotonic-clock.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:clocks@0.2.1;
package wasi:clocks@0.2.2;
/// WASI Monotonic Clock is a clock API intended to let users measure elapsed
/// time.
///
Expand All @@ -10,7 +10,7 @@ package wasi:[email protected];
@since(version = 0.2.0)
interface monotonic-clock {
@since(version = 0.2.0)
use wasi:io/poll@0.2.1.{pollable};
use wasi:io/poll@0.2.2.{pollable};

/// An instant in time, in nanoseconds. An instant is relative to an
/// unspecified initial value, and can only be compared to instances from
Expand Down
2 changes: 1 addition & 1 deletion wit/timezone.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:clocks@0.2.1;
package wasi:clocks@0.2.2;

@unstable(feature = clocks-timezone)
interface timezone {
Expand Down
2 changes: 1 addition & 1 deletion wit/wall-clock.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:clocks@0.2.1;
package wasi:clocks@0.2.2;
/// 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.
Expand Down
2 changes: 1 addition & 1 deletion wit/world.wit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package wasi:clocks@0.2.1;
package wasi:clocks@0.2.2;

@since(version = 0.2.0)
world imports {
Expand Down

0 comments on commit 110b161

Please sign in to comment.