|
2 | 2 | <ul> |
3 | 3 | <li>Imports: |
4 | 4 | <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> |
11 | 11 | </ul> |
12 | 12 | </li> |
13 | 13 | </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> |
15 | 15 | <hr /> |
16 | 16 | <h3>Types</h3> |
17 | 17 | <h4><a id="error"></a><code>resource error</code></h4> |
@@ -44,7 +44,7 @@ hazard.</p> |
44 | 44 | <ul> |
45 | 45 | <li><a id="method_error_to_debug_string.0"></a> <code>string</code></li> |
46 | 46 | </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> |
48 | 48 | <p>A poll API intended to let users wait for I/O events on multiple handles |
49 | 49 | at once.</p> |
50 | 50 | <hr /> |
@@ -97,7 +97,7 @@ being ready for I/O.</p> |
97 | 97 | <ul> |
98 | 98 | <li><a id="poll.0"></a> list<<code>u32</code>></li> |
99 | 99 | </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> |
101 | 101 | <p>WASI I/O is an I/O abstraction API which is currently focused on providing |
102 | 102 | stream types.</p> |
103 | 103 | <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> |
270 | 270 | <h4><a id="method_output_stream_blocking_write_and_flush"></a><code>[method]output-stream.blocking-write-and-flush: func</code></h4> |
271 | 271 | <p>Perform a write of up to 4096 bytes, and then flush the stream. Block |
272 | 272 | 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> |
292 | 280 | <h5>Params</h5> |
293 | 281 | <ul> |
294 | 282 | <li><a id="method_output_stream_blocking_write_and_flush.self"></a><code>self</code>: borrow<<a href="#output_stream"><a href="#output_stream"><code>output-stream</code></a></a>></li> |
@@ -362,24 +350,8 @@ that should be written.</p> |
362 | 350 | <p>Perform a write of up to 4096 zeroes, and then flush the stream. |
363 | 351 | Block until all of these operations are complete, or an error |
364 | 352 | 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> |
383 | 355 | <h5>Params</h5> |
384 | 356 | <ul> |
385 | 357 | <li><a id="method_output_stream_blocking_write_zeroes_and_flush.self"></a><code>self</code>: borrow<<a href="#output_stream"><a href="#output_stream"><code>output-stream</code></a></a>></li> |
@@ -427,7 +399,7 @@ is ready for reading, before performing the <code>splice</code>.</p> |
427 | 399 | <ul> |
428 | 400 | <li><a id="method_output_stream_blocking_splice.0"></a> result<<code>u64</code>, <a href="#stream_error"><a href="#stream_error"><code>stream-error</code></a></a>></li> |
429 | 401 | </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> |
431 | 403 | <p>WASI Wall Clock is a clock API intended to let users query the current |
432 | 404 | time. The name "wall" makes an analogy to a "clock on the wall", which |
433 | 405 | 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>.</ |
468 | 440 | <ul> |
469 | 441 | <li><a id="resolution.0"></a> <a href="#datetime"><a href="#datetime"><code>datetime</code></a></a></li> |
470 | 442 | </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> |
472 | 444 | <p>WASI filesystem is a filesystem API primarily intended to let users run WASI |
473 | 445 | programs that access their files on their existing filesystems, without |
474 | 446 | significant overhead.</p> |
@@ -1346,7 +1318,7 @@ errors are filesystem-related errors.</p> |
1346 | 1318 | <ul> |
1347 | 1319 | <li><a id="filesystem_error_code.0"></a> option<<a href="#error_code"><a href="#error_code"><code>error-code</code></a></a>></li> |
1348 | 1320 | </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> |
1350 | 1322 | <hr /> |
1351 | 1323 | <h3>Types</h3> |
1352 | 1324 | <h4><a id="descriptor"></a><code>type descriptor</code></h4> |
|
0 commit comments