@@ -267,25 +267,13 @@ the last call to check-write provided a permit.</p>
267267<h4 ><a id =" method_output_stream_blocking_write_and_flush " ></a ><code >[method]output-stream.blocking-write-and-flush: func</code ></h4 >
268268<p >Perform a write of up to 4096 bytes, and then flush the stream. Block
269269until all of these operations are complete, or an error occurs.</p >
270- <p >This is a convenience wrapper around the use of <code >check-write</code >,
271- <code >subscribe</code >, <code >write</code >, and <code >flush</code >, and is implemented with the
272- following pseudo-code:</p >
273- <pre ><code class =" language-text " >let pollable = this.subscribe();
274- while !contents.is_empty() {
275- // Wait for the stream to become writable
276- pollable.block();
277- let Ok(n) = this.check-write(); // eliding error handling
278- let len = min(n, contents.len());
279- let (chunk, rest) = contents.split_at(len);
280- this.write(chunk ); // eliding error handling
281- contents = rest;
282- }
283- this.flush();
284- // Wait for completion of `flush`
285- pollable.block();
286- // Check for any errors that arose during `flush`
287- let _ = this.check-write(); // eliding error handling
288- </code ></pre >
270+ <p >Returns success when all of the contents written are successfully
271+ flushed to output. If an error occurs at any point before all
272+ contents are successfully flushed, that error is returned as soon as
273+ possible. If writing and flushing the complete contents causes the
274+ stream to become closed, this call should return success, and
275+ subsequent calls to check-write or other interfaces should return
276+ stream-error::closed.</p >
289277<h5 >Params</h5 >
290278<ul >
291279<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 >
@@ -359,24 +347,8 @@ that should be written.</p>
359347<p >Perform a write of up to 4096 zeroes, and then flush the stream.
360348Block until all of these operations are complete, or an error
361349occurs.</p >
362- <p >This is a convenience wrapper around the use of <code >check-write</code >,
363- <code >subscribe</code >, <code >write-zeroes</code >, and <code >flush</code >, and is implemented with
364- the following pseudo-code:</p >
365- <pre ><code class =" language-text " >let pollable = this.subscribe();
366- while num_zeroes != 0 {
367- // Wait for the stream to become writable
368- pollable.block();
369- let Ok(n) = this.check-write(); // eliding error handling
370- let len = min(n, num_zeroes);
371- this.write-zeroes(len); // eliding error handling
372- num_zeroes -= len;
373- }
374- this.flush();
375- // Wait for completion of `flush`
376- pollable.block();
377- // Check for any errors that arose during `flush`
378- let _ = this.check-write(); // eliding error handling
379- </code ></pre >
350+ <p >Functionality is equivelant to <code >blocking-write-and-flush</code > with
351+ contents given as a list of len containing only zeroes.</p >
380352<h5 >Params</h5 >
381353<ul >
382354<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 >
0 commit comments