Trait archiv::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>