pub trait EncodeBytes {
    // Required methods
    fn encode_chunk<W: Write>(&mut self, writer: &mut W, bytes: &[u8]) -> Result;
    fn flush<W: Write>(&mut self, writer: &mut W) -> Result;
}
Expand description

Transforms given bytes and writes to the writer.

The encoder is allowed to be buffered (and probably should be). The design passing writer each time bypasses the need for GAT.

Required Methods§

source

fn encode_chunk<W: Write>(&mut self, writer: &mut W, bytes: &[u8]) -> Result

Transform the provided slice and write to the writer.

This is similar to the write_all method on io::Write.

source

fn flush<W: Write>(&mut self, writer: &mut W) -> Result

Write data in buffer (if any) to the writer.

Implementors§