Copies bytes from the stream to a writer until a certain byte occurs.
fn copy_until<W>(&mut self, dst: &mut W, b: u8) -> Result<usize, Errno> where W: Write,
| Name | Description |
|---|---|
| dst | The writer into which the stream will be piped. |
| b | The byte at which to stop. |
Returns the total number of bytes copied.
The stop-byte itself is copied to the destination. The copied bytes are no longer available for further read operations. If an error occurs, the error is returned immediately. In this case no bytes are lost since all read bytes have already been copied to the dst variable. The number of copied bytes is lost unless the dst variable has a means to obtain the number of copied bytes.