Trait Write
pub trait Write {
// Required methods
fn write(&mut self, buf: &[u8]) -> Result<usize, AxErrorKind>;
fn flush(&mut self) -> Result<(), AxErrorKind>;
// Provided methods
fn write_all(&mut self, buf: &[u8]) -> Result<(), AxErrorKind> { ... }
fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), AxErrorKind> { ... }
}Expand description
A trait for objects which are byte-oriented sinks.
Required Methods§
fn write(&mut self, buf: &[u8]) -> Result<usize, AxErrorKind>
fn write(&mut self, buf: &[u8]) -> Result<usize, AxErrorKind>
Write a buffer into this writer, returning how many bytes were written.
fn flush(&mut self) -> Result<(), AxErrorKind>
fn flush(&mut self) -> Result<(), AxErrorKind>
Flush this output stream, ensuring that all intermediately buffered contents reach their destination.
Provided Methods§
fn write_all(&mut self, buf: &[u8]) -> Result<(), AxErrorKind>
fn write_all(&mut self, buf: &[u8]) -> Result<(), AxErrorKind>
Attempts to write an entire buffer into this writer.
fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), AxErrorKind>
fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), AxErrorKind>
Writes a formatted string into this writer, returning any error encountered.