Trait CompressorWriter

Source
pub trait CompressorWriter {
    // Required methods
    fn write(&mut self, data: &[u8]) -> CompressorResult<usize>;
    fn flush(&mut self) -> CompressorResult<()>;
    fn close(&mut self) -> CompressorResult<()>;
    fn reset(&mut self);
    fn len(&self) -> usize;
    fn read(&mut self, buf: &mut [u8]) -> CompressorResult<usize>;
}
Expand description

Compressor Writer

A trait that expands the standard library Write trait to include compression-specific methods and return CompressorResult instead of standard library Result.

Required Methods§

Source

fn write(&mut self, data: &[u8]) -> CompressorResult<usize>

Writes the given data to the compressor.

Source

fn flush(&mut self) -> CompressorResult<()>

Flushes the buffer.

Source

fn close(&mut self) -> CompressorResult<()>

Closes the compressor.

Source

fn reset(&mut self)

Resets the compressor.

Source

fn len(&self) -> usize

Returns the length of the compressed data.

Source

fn read(&mut self, buf: &mut [u8]) -> CompressorResult<usize>

Reads the compressed data into the given buffer. Returns the number of bytes read.

Implementors§

Source§

impl CompressorWriter for VariantCompressor

Available on crate feature std only.
Source§

impl CompressorWriter for BrotliCompressor

Available on crate feature std only.
Source§

impl CompressorWriter for RatioCompressor

Available on crate feature std only.
Source§

impl CompressorWriter for ShadowCompressor

Available on crate feature std only.
Source§

impl CompressorWriter for ZlibCompressor