Skip to content

Commit 1cd1b28

Browse files
committed
Address review comments.
1 parent b53ab11 commit 1cd1b28

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

standard/io/docs.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,7 +1482,7 @@ Read bytes from an input byte stream source.
14821482
On success, `$size` indicates the number of bytes read, and
14831483
`$read_status` indicates the state of the stream.
14841484

1485-
When `$read_status` is `$read`, `$size` is equal to the total buffer size
1485+
When `$read_status` is `$ready`, `$size` is equal to the total buffer size
14861486
of `$iovs`.
14871487

14881488
When `$read_status` is `$end`, or on failure, subsequent calls to [`read`](#read)
@@ -1526,7 +1526,7 @@ Consume bytes from an input byte stream source, discarding the data.
15261526
On success, `$size` indicates the number of bytes read, and
15271527
`$read_status` indicates the state of the stream.
15281528

1529-
When `$read_status` is `$read`, `$size` is equal to the total buffer size
1529+
When `$read_status` is `$ready`, `$size` is equal to the total buffer size
15301530
of `$iovs`.
15311531

15321532
When `$read_status` is `$end`, or on failure, subsequent calls to [`read`](#read)
@@ -1730,7 +1730,7 @@ The pseudonym.
17301730
---
17311731

17321732
#### <a href="#write_pseudonym" name="write_pseudonym"></a> `write_pseudonym(source: output_byte_stream, name: pseudonym) -> Result<(), ()>`
1733-
Write a pseudonym's nameto the output stream.
1733+
Write a pseudonym's name to the output stream.
17341734

17351735
This function traps if the pseudonym is not one obtained from calling
17361736
[`input_pseudonym`](#input_pseudonym) or [`output_pseudonym`](#output_pseudonym) with a `$where` parameter of
@@ -1742,11 +1742,14 @@ exposed.
17421742

17431743
##### Params
17441744
- <a href="#write_pseudonym.source" name="write_pseudonym.source"></a> `source`: [`output_byte_stream`](#output_byte_stream)
1745+
The output to write to.
17451746

17461747
- <a href="#write_pseudonym.name" name="write_pseudonym.name"></a> `name`: [`pseudonym`](#pseudonym)
1748+
The pseudonym representing the name to write.
17471749

17481750
##### Results
17491751
- <a href="#write_pseudonym.result" name="write_pseudonym.result"></a> `result`: `Result<(), ()>`
1752+
Indicate success or failure.
17501753

17511754
###### Variant cases
17521755
- <a href="#write_pseudonym.result.ok" name="write_pseudonym.result.ok"></a> `ok`
@@ -1786,7 +1789,7 @@ On success, return the number of bytes forwarded.
17861789
---
17871790

17881791
#### <a href="#forward_n" name="forward_n"></a> `forward_n(source: input_byte_stream, sink: output_byte_stream, len: size) -> Result<(size, read_status), ()>`
1789-
Forward up to `$n` bytes from an input stream to an output stream.
1792+
Forward up to `$len` bytes from an input stream to an output stream.
17901793

17911794
If a failure occurs on the output stream, the remaining data from the
17921795
input stream is consumed and discarded.
@@ -1833,8 +1836,10 @@ transmitted to the output.
18331836
##### Params
18341837
##### Results
18351838
- <a href="#pipe.source" name="pipe.source"></a> `source`: [`input_byte_stream`](#input_byte_stream)
1839+
A stream for reading from the created pipe.
18361840

18371841
- <a href="#pipe.sink" name="pipe.sink"></a> `sink`: [`output_byte_stream`](#output_byte_stream)
1842+
A stream for writing to the created pipe.
18381843

18391844

18401845
---
@@ -1845,4 +1850,5 @@ Return an output stream which discards data sent to it.
18451850
##### Params
18461851
##### Results
18471852
- <a href="#null.sink" name="null.sink"></a> `sink`: [`output_byte_stream`](#output_byte_stream)
1853+
A stream for writing bytes to be discarded.
18481854

standard/io/witx/io_streams.witx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
;;; On success, `$size` indicates the number of bytes read, and
6363
;;; `$read_status` indicates the state of the stream.
6464
;;;
65-
;;; When `$read_status` is `$read`, `$size` is equal to the total buffer size
65+
;;; When `$read_status` is `$ready`, `$size` is equal to the total buffer size
6666
;;; of `$iovs`.
6767
;;;
6868
;;; When `$read_status` is `$end`, or on failure, subsequent calls to `read`
@@ -81,7 +81,7 @@
8181
;;; On success, `$size` indicates the number of bytes read, and
8282
;;; `$read_status` indicates the state of the stream.
8383
;;;
84-
;;; When `$read_status` is `$read`, `$size` is equal to the total buffer size
84+
;;; When `$read_status` is `$ready`, `$size` is equal to the total buffer size
8585
;;; of `$iovs`.
8686
;;;
8787
;;; When `$read_status` is `$end`, or on failure, subsequent calls to `read`
@@ -199,7 +199,7 @@
199199
(result $name $pseudonym)
200200
)
201201

202-
;;; Write a pseudonym's nameto the output stream.
202+
;;; Write a pseudonym's name to the output stream.
203203
;;;
204204
;;; This function traps if the pseudonym is not one obtained from calling
205205
;;; `input_pseudonym` or `output_pseudonym` with a `$where` parameter of
@@ -209,8 +209,11 @@
209209
;;; which display the name in contexts where the name is already
210210
;;; exposed.
211211
(@interface func (export "write_pseudonym")
212+
;;; The output to write to.
212213
(param $source $output_byte_stream)
214+
;;; The pseudonym representing the name to write.
213215
(param $name $pseudonym)
216+
;;; Indicate success or failure.
214217
(result $result (expected (error)))
215218
)
216219

@@ -227,7 +230,7 @@
227230
(result $result (expected $size (error)))
228231
)
229232

230-
;;; Forward up to `$n` bytes from an input stream to an output stream.
233+
;;; Forward up to `$len` bytes from an input stream to an output stream.
231234
;;;
232235
;;; If a failure occurs on the output stream, the remaining data from the
233236
;;; input stream is consumed and discarded.
@@ -245,12 +248,15 @@
245248
;;; Return an input stream and an output stream where the input is
246249
;;; transmitted to the output.
247250
(@interface func (export "pipe")
251+
;;; A stream for reading from the created pipe.
248252
(result $source $input_byte_stream)
253+
;;; A stream for writing to the created pipe.
249254
(result $sink $output_byte_stream)
250255
)
251256

252257
;;; Return an output stream which discards data sent to it.
253258
(@interface func (export "null")
259+
;;; A stream for writing bytes to be discarded.
254260
(result $sink $output_byte_stream)
255261
)
256262
)

0 commit comments

Comments
 (0)