kvarn_utils::prelude

Trait Write

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

    // Provided methods
    fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize, Error> { ... }
    fn is_write_vectored(&self) -> bool { ... }
    fn write_all(&mut self, buf: &[u8]) -> Result<(), Error> { ... }
    fn write_all_vectored(
        &mut self,
        bufs: &mut [IoSlice<'_>],
    ) -> Result<(), Error> { ... }
    fn write_fmt(&mut self, fmt: Arguments<'_>) -> Result<(), Error> { ... }
    fn by_ref(&mut self) -> &mut Self
       where Self: Sized { ... }
}
Expand description

A trait for objects which are byte-oriented sinks.

Implementors of the Write trait are sometimes called ‘writers’.

Writers are defined by two required methods,