Skip to main content

Sink

Trait Sink 

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

A sink for encoded bytes.

Required Methods§

Source

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

Write all of buf.

§Errors

Returns PixelsError::Io if the underlying writer fails.

Source

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

Flush any buffered bytes to the destination.

§Errors

Returns PixelsError::Io if the underlying writer fails.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<W> Sink for W
where W: Write + Send,