[−][src]Trait linux::util::io::Write
Objects that wrap a byte-stream for writing.
Required methods
fn gather_write(&mut self, buf: &[&[u8]]) -> Result<usize>
Writes multiple buffers to the byte-stream.
[argument, buf] The buffers to be written.
[return_value] Returns the total number of bytes written.
= Remarks
The method starts at the first buffer and writes each buffer completely before moving to the next one.
fn flush(&mut self) -> Result<()>
Provided methods
fn write(&mut self, buf: &[u8]) -> Result<usize>
Write a buffer to the byte stream.
[argument, buf] The buffer to be written.
[return_value] Returns the total number of bytes written.
= Remarks
:gather: link:lrs::io::Write::gather_write[gather_write]
The default implementation calls {gather} with a single buffer.
= See also
- {gather}
fn write_all(&mut self, buf: &[u8]) -> Result<usize>
Tries to write the complete buffer to the byte-stream.
[argument, buf] The buffer to be written.
[return_value] Returns the total number of bytes written.
= Remarks
:write: link:lrs::io::Write::writewrite
The default implementation calls write
multiple times until the whole buffer has
been written. If an error occurs, the error is returned immediately and the number
of bytes written is lost. This method should thus not be used in reliable
applications.
fn write_str(&mut self, buf: &str) -> Result<usize>
Writes a string to the byte-stream.
[argument, buf] The string to be written.
[return_value] Returns the total number of bytes written.
= Remarks
This is a convenience method that simply calls write
.