Sink

Trait Sink 

Source
pub trait Sink: Send {
    // Required methods
    fn sink(&mut self, buffer: &[u8]) -> Result<(), Error>;
    fn flush(self) -> Result<(), Error>;
}
Expand description

Something that can write the contents of a buffer somewhere

For example, this is implemented for a file writer.

Required Methods§

Source

fn sink(&mut self, buffer: &[u8]) -> Result<(), Error>

Write all data from the buffer to the sink

Source

fn flush(self) -> Result<(), Error>

Complete and flush any remaining data from the sink

Implementors§

Source§

impl<W: Write + Send> Sink for WriterSink<W>