Compress

Trait Compress 

Source
pub trait Compress<W> {
    // Required methods
    fn write_item(&mut self, item: &[u8]) -> Result<u64, Error>;
    fn finish(self) -> Result<W, Error>;
    fn flush(&mut self) -> Result<(), Error>;
}
Expand description

Trait for writing compressed streams

Required Methods§

Source

fn write_item(&mut self, item: &[u8]) -> Result<u64, Error>

Append an item to the writer

Source

fn finish(self) -> Result<W, Error>

Complete the writer

Source

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

Make a moderate amount of effort to ensure there will be no IO errors in the future.

Implementors§

Source§

impl<'d, W: Write> Compress<W> for CompressItem<'d, W>

Source§

impl<'e, W: Write> Compress<W> for CompressStream<'e, W>