Trait libax::io::Write

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

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

A trait for objects which are byte-oriented sinks.

Required Methods§

source

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

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

source

fn flush(&mut self) -> Result<(), AxError>

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

Provided Methods§

source

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

Attempts to write an entire buffer into this writer.

source

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

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

Implementors§

source§

impl Write for File

source§

impl Write for TcpStream

Available on crate feature net only.
source§

impl Write for Stdout