Trait axio::Write

source ·
pub trait Write {
    // Required methods
    fn write(&mut self, buf: &[u8]) -> Result<usize>;
    fn flush(&mut self) -> Result;

    // Provided methods
    fn write_all(&mut self, buf: &[u8]) -> Result { ... }
    fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<()> { ... }
}
Expand description

A trait for objects which are byte-oriented sinks.

Required Methods§

source

fn write(&mut self, buf: &[u8]) -> Result<usize>

Write a buffer into this writer, returning how many bytes were written.

source

fn flush(&mut self) -> Result

Flush this output stream, ensuring that all intermediately buffered contents reach their destination.

Provided Methods§

source

fn write_all(&mut self, buf: &[u8]) -> Result

Attempts to write an entire buffer into this writer.

source

fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<()>

Writes a formatted string into this writer, returning any error encountered.

Implementors§