Skip to content

Commit 651ad56

Browse files
authored
Merge pull request #178 from WebAssembly/release-v0.2.7
Release v0.2.7
2 parents 7c44969 + 662d241 commit 651ad56

File tree

13 files changed

+48
-108
lines changed

13 files changed

+48
-108
lines changed

imports.md

Lines changed: 21 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
<ul>
33
<li>Imports:
44
<ul>
5-
<li>interface <a href="#wasi_io_error_0_2_6"><code>wasi:io/error@0.2.6</code></a></li>
6-
<li>interface <a href="#wasi_io_poll_0_2_6"><code>wasi:io/poll@0.2.6</code></a></li>
7-
<li>interface <a href="#wasi_io_streams_0_2_6"><code>wasi:io/streams@0.2.6</code></a></li>
8-
<li>interface <a href="#wasi_clocks_wall_clock_0_2_6"><code>wasi:clocks/wall-clock@0.2.6</code></a></li>
9-
<li>interface <a href="#wasi_filesystem_types_0_2_6"><code>wasi:filesystem/types@0.2.6</code></a></li>
10-
<li>interface <a href="#wasi_filesystem_preopens_0_2_6"><code>wasi:filesystem/preopens@0.2.6</code></a></li>
5+
<li>interface <a href="#wasi_io_error_0_2_7"><code>wasi:io/error@0.2.7</code></a></li>
6+
<li>interface <a href="#wasi_io_poll_0_2_7"><code>wasi:io/poll@0.2.7</code></a></li>
7+
<li>interface <a href="#wasi_io_streams_0_2_7"><code>wasi:io/streams@0.2.7</code></a></li>
8+
<li>interface <a href="#wasi_clocks_wall_clock_0_2_7"><code>wasi:clocks/wall-clock@0.2.7</code></a></li>
9+
<li>interface <a href="#wasi_filesystem_types_0_2_7"><code>wasi:filesystem/types@0.2.7</code></a></li>
10+
<li>interface <a href="#wasi_filesystem_preopens_0_2_7"><code>wasi:filesystem/preopens@0.2.7</code></a></li>
1111
</ul>
1212
</li>
1313
</ul>
14-
<h2><a id="wasi_io_error_0_2_6"></a>Import interface wasi:io/error@0.2.6</h2>
14+
<h2><a id="wasi_io_error_0_2_7"></a>Import interface wasi:io/error@0.2.7</h2>
1515
<hr />
1616
<h3>Types</h3>
1717
<h4><a id="error"></a><code>resource error</code></h4>
@@ -44,7 +44,7 @@ hazard.</p>
4444
<ul>
4545
<li><a id="method_error_to_debug_string.0"></a> <code>string</code></li>
4646
</ul>
47-
<h2><a id="wasi_io_poll_0_2_6"></a>Import interface wasi:io/poll@0.2.6</h2>
47+
<h2><a id="wasi_io_poll_0_2_7"></a>Import interface wasi:io/poll@0.2.7</h2>
4848
<p>A poll API intended to let users wait for I/O events on multiple handles
4949
at once.</p>
5050
<hr />
@@ -97,7 +97,7 @@ being ready for I/O.</p>
9797
<ul>
9898
<li><a id="poll.0"></a> list&lt;<code>u32</code>&gt;</li>
9999
</ul>
100-
<h2><a id="wasi_io_streams_0_2_6"></a>Import interface wasi:io/streams@0.2.6</h2>
100+
<h2><a id="wasi_io_streams_0_2_7"></a>Import interface wasi:io/streams@0.2.7</h2>
101101
<p>WASI I/O is an I/O abstraction API which is currently focused on providing
102102
stream types.</p>
103103
<p>In the future, the component model is expected to add built-in stream types;
@@ -270,25 +270,13 @@ the last call to check-write provided a permit.</p>
270270
<h4><a id="method_output_stream_blocking_write_and_flush"></a><code>[method]output-stream.blocking-write-and-flush: func</code></h4>
271271
<p>Perform a write of up to 4096 bytes, and then flush the stream. Block
272272
until all of these operations are complete, or an error occurs.</p>
273-
<p>This is a convenience wrapper around the use of <code>check-write</code>,
274-
<code>subscribe</code>, <code>write</code>, and <code>flush</code>, and is implemented with the
275-
following pseudo-code:</p>
276-
<pre><code class="language-text">let pollable = this.subscribe();
277-
while !contents.is_empty() {
278-
// Wait for the stream to become writable
279-
pollable.block();
280-
let Ok(n) = this.check-write(); // eliding error handling
281-
let len = min(n, contents.len());
282-
let (chunk, rest) = contents.split_at(len);
283-
this.write(chunk ); // eliding error handling
284-
contents = rest;
285-
}
286-
this.flush();
287-
// Wait for completion of `flush`
288-
pollable.block();
289-
// Check for any errors that arose during `flush`
290-
let _ = this.check-write(); // eliding error handling
291-
</code></pre>
273+
<p>Returns success when all of the contents written are successfully
274+
flushed to output. If an error occurs at any point before all
275+
contents are successfully flushed, that error is returned as soon as
276+
possible. If writing and flushing the complete contents causes the
277+
stream to become closed, this call should return success, and
278+
subsequent calls to check-write or other interfaces should return
279+
stream-error::closed.</p>
292280
<h5>Params</h5>
293281
<ul>
294282
<li><a id="method_output_stream_blocking_write_and_flush.self"></a><code>self</code>: borrow&lt;<a href="#output_stream"><a href="#output_stream"><code>output-stream</code></a></a>&gt;</li>
@@ -362,24 +350,8 @@ that should be written.</p>
362350
<p>Perform a write of up to 4096 zeroes, and then flush the stream.
363351
Block until all of these operations are complete, or an error
364352
occurs.</p>
365-
<p>This is a convenience wrapper around the use of <code>check-write</code>,
366-
<code>subscribe</code>, <code>write-zeroes</code>, and <code>flush</code>, and is implemented with
367-
the following pseudo-code:</p>
368-
<pre><code class="language-text">let pollable = this.subscribe();
369-
while num_zeroes != 0 {
370-
// Wait for the stream to become writable
371-
pollable.block();
372-
let Ok(n) = this.check-write(); // eliding error handling
373-
let len = min(n, num_zeroes);
374-
this.write-zeroes(len); // eliding error handling
375-
num_zeroes -= len;
376-
}
377-
this.flush();
378-
// Wait for completion of `flush`
379-
pollable.block();
380-
// Check for any errors that arose during `flush`
381-
let _ = this.check-write(); // eliding error handling
382-
</code></pre>
353+
<p>Functionality is equivelant to <code>blocking-write-and-flush</code> with
354+
contents given as a list of len containing only zeroes.</p>
383355
<h5>Params</h5>
384356
<ul>
385357
<li><a id="method_output_stream_blocking_write_zeroes_and_flush.self"></a><code>self</code>: borrow&lt;<a href="#output_stream"><a href="#output_stream"><code>output-stream</code></a></a>&gt;</li>
@@ -427,7 +399,7 @@ is ready for reading, before performing the <code>splice</code>.</p>
427399
<ul>
428400
<li><a id="method_output_stream_blocking_splice.0"></a> result&lt;<code>u64</code>, <a href="#stream_error"><a href="#stream_error"><code>stream-error</code></a></a>&gt;</li>
429401
</ul>
430-
<h2><a id="wasi_clocks_wall_clock_0_2_6"></a>Import interface wasi:clocks/wall-clock@0.2.6</h2>
402+
<h2><a id="wasi_clocks_wall_clock_0_2_7"></a>Import interface wasi:clocks/wall-clock@0.2.7</h2>
431403
<p>WASI Wall Clock is a clock API intended to let users query the current
432404
time. The name &quot;wall&quot; makes an analogy to a &quot;clock on the wall&quot;, which
433405
is not necessarily monotonic as it may be reset.</p>
@@ -468,7 +440,7 @@ also known as <a href="https://en.wikipedia.org/wiki/Unix_time">Unix Time</a>.</
468440
<ul>
469441
<li><a id="resolution.0"></a> <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></li>
470442
</ul>
471-
<h2><a id="wasi_filesystem_types_0_2_6"></a>Import interface wasi:filesystem/types@0.2.6</h2>
443+
<h2><a id="wasi_filesystem_types_0_2_7"></a>Import interface wasi:filesystem/types@0.2.7</h2>
472444
<p>WASI filesystem is a filesystem API primarily intended to let users run WASI
473445
programs that access their files on their existing filesystems, without
474446
significant overhead.</p>
@@ -1346,7 +1318,7 @@ errors are filesystem-related errors.</p>
13461318
<ul>
13471319
<li><a id="filesystem_error_code.0"></a> option&lt;<a href="#error_code"><a href="#error_code"><code>error-code</code></a></a>&gt;</li>
13481320
</ul>
1349-
<h2><a id="wasi_filesystem_preopens_0_2_6"></a>Import interface wasi:filesystem/preopens@0.2.6</h2>
1321+
<h2><a id="wasi_filesystem_preopens_0_2_7"></a>Import interface wasi:filesystem/preopens@0.2.7</h2>
13501322
<hr />
13511323
<h3>Types</h3>
13521324
<h4><a id="descriptor"></a><code>type descriptor</code></h4>

wit/deps.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[clocks]
22
url = "https://github.com/WebAssembly/wasi-clocks/archive/main.tar.gz"
3-
sha256 = "59b8db7b6f3f8a72418510453c1fa9e437c7c7c2369c0bd5da83aa5d6d1d9b73"
4-
sha512 = "06ce14bbf34d5588ed0c26bd932d46b3025c16723d5b4558def5b8107781b2251471c1f7170640342e3d4f78efb560d5ff6383c6a127c1d9e757e83db31a0185"
3+
sha256 = "d0a8d048c41b566b978cd8ecd03fa51ec1f65af4c26be2f0fc9cfdd7dd6f34f3"
4+
sha512 = "8d1c9ddaaea70ae54376bfc02dcdd0437336fb4fc67f89763ce09540caefe84cbae89a8de3605aa7613c49188636e925047bcd150c2c60685850095fefb68b73"
55

66
[io]
77
url = "https://github.com/WebAssembly/wasi-io/archive/main.tar.gz"
8-
sha256 = "671761f464d312e6c26bcaab5e79fe14ac876b72267867579d5c65e053fe2301"
9-
sha512 = "57e5ed34fa85f35899b324ac7a2473c5fa5cece51d07e6f077637191fadd3c8b6f79324d31a8d497a6ce7b92cfb2a2505ab894337e2c82889f1bdb21f4f24634"
8+
sha256 = "62ae80f2e340cddbac8e94f78e6270735aea536367ecb98de5f4ac6aef66b5c4"
9+
sha512 = "a02a1ebd261ae884b0315b3528d1a93819ddc4b616f66c77f2bea9dd1de888208dc3b9004a553363f5e8491ea925d65ebbd0d68eaa87238316b47469a3bf97bb"

wit/deps/clocks/monotonic-clock.wit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:clocks@0.2.6;
1+
package wasi:clocks@0.2.7;
22
/// WASI Monotonic Clock is a clock API intended to let users measure elapsed
33
/// time.
44
///
@@ -10,7 +10,7 @@ package wasi:clocks@0.2.6;
1010
@since(version = 0.2.0)
1111
interface monotonic-clock {
1212
@since(version = 0.2.0)
13-
use wasi:io/poll@0.2.6.{pollable};
13+
use wasi:io/poll@0.2.7.{pollable};
1414

1515
/// An instant in time, in nanoseconds. An instant is relative to an
1616
/// unspecified initial value, and can only be compared to instances from

wit/deps/clocks/timezone.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:clocks@0.2.6;
1+
package wasi:clocks@0.2.7;
22

33
@unstable(feature = clocks-timezone)
44
interface timezone {

wit/deps/clocks/wall-clock.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:clocks@0.2.6;
1+
package wasi:clocks@0.2.7;
22
/// WASI Wall Clock is a clock API intended to let users query the current
33
/// time. The name "wall" makes an analogy to a "clock on the wall", which
44
/// is not necessarily monotonic as it may be reset.

wit/deps/clocks/world.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:clocks@0.2.6;
1+
package wasi:clocks@0.2.7;
22

33
@since(version = 0.2.0)
44
world imports {

wit/deps/io/error.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:io@0.2.6;
1+
package wasi:io@0.2.7;
22

33
@since(version = 0.2.0)
44
interface error {

wit/deps/io/poll.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:io@0.2.6;
1+
package wasi:io@0.2.7;
22

33
/// A poll API intended to let users wait for I/O events on multiple handles
44
/// at once.

wit/deps/io/streams.wit

Lines changed: 10 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:io@0.2.6;
1+
package wasi:io@0.2.7;
22

33
/// WASI I/O is an I/O abstraction API which is currently focused on providing
44
/// stream types.
@@ -154,27 +154,13 @@ interface streams {
154154
/// Perform a write of up to 4096 bytes, and then flush the stream. Block
155155
/// until all of these operations are complete, or an error occurs.
156156
///
157-
/// This is a convenience wrapper around the use of `check-write`,
158-
/// `subscribe`, `write`, and `flush`, and is implemented with the
159-
/// following pseudo-code:
160-
///
161-
/// ```text
162-
/// let pollable = this.subscribe();
163-
/// while !contents.is_empty() {
164-
/// // Wait for the stream to become writable
165-
/// pollable.block();
166-
/// let Ok(n) = this.check-write(); // eliding error handling
167-
/// let len = min(n, contents.len());
168-
/// let (chunk, rest) = contents.split_at(len);
169-
/// this.write(chunk ); // eliding error handling
170-
/// contents = rest;
171-
/// }
172-
/// this.flush();
173-
/// // Wait for completion of `flush`
174-
/// pollable.block();
175-
/// // Check for any errors that arose during `flush`
176-
/// let _ = this.check-write(); // eliding error handling
177-
/// ```
157+
/// Returns success when all of the contents written are successfully
158+
/// flushed to output. If an error occurs at any point before all
159+
/// contents are successfully flushed, that error is returned as soon as
160+
/// possible. If writing and flushing the complete contents causes the
161+
/// stream to become closed, this call should return success, and
162+
/// subsequent calls to check-write or other interfaces should return
163+
/// stream-error::closed.
178164
@since(version = 0.2.0)
179165
blocking-write-and-flush: func(
180166
contents: list<u8>
@@ -227,26 +213,8 @@ interface streams {
227213
/// Block until all of these operations are complete, or an error
228214
/// occurs.
229215
///
230-
/// This is a convenience wrapper around the use of `check-write`,
231-
/// `subscribe`, `write-zeroes`, and `flush`, and is implemented with
232-
/// the following pseudo-code:
233-
///
234-
/// ```text
235-
/// let pollable = this.subscribe();
236-
/// while num_zeroes != 0 {
237-
/// // Wait for the stream to become writable
238-
/// pollable.block();
239-
/// let Ok(n) = this.check-write(); // eliding error handling
240-
/// let len = min(n, num_zeroes);
241-
/// this.write-zeroes(len); // eliding error handling
242-
/// num_zeroes -= len;
243-
/// }
244-
/// this.flush();
245-
/// // Wait for completion of `flush`
246-
/// pollable.block();
247-
/// // Check for any errors that arose during `flush`
248-
/// let _ = this.check-write(); // eliding error handling
249-
/// ```
216+
/// Functionality is equivelant to `blocking-write-and-flush` with
217+
/// contents given as a list of len containing only zeroes.
250218
@since(version = 0.2.0)
251219
blocking-write-zeroes-and-flush: func(
252220
/// The number of zero-bytes to write

wit/deps/io/world.wit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package wasi:io@0.2.6;
1+
package wasi:io@0.2.7;
22

33
@since(version = 0.2.0)
44
world imports {

0 commit comments

Comments
 (0)