pub trait CompressorWriter {
// Required methods
fn write(&mut self, data: &[u8]) -> Result<usize, CompressorError>;
fn flush(&mut self) -> Result<(), CompressorError>;
fn close(&mut self) -> Result<(), CompressorError>;
fn reset(&mut self);
fn len(&self) -> usize;
fn read(&mut self, buf: &mut [u8]) -> Result<usize, CompressorError>;
}
Available on crate feature
protocol
only.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§
Sourcefn write(&mut self, data: &[u8]) -> Result<usize, CompressorError>
fn write(&mut self, data: &[u8]) -> Result<usize, CompressorError>
Writes the given data to the compressor.
Sourcefn flush(&mut self) -> Result<(), CompressorError>
fn flush(&mut self) -> Result<(), CompressorError>
Flushes the buffer.
Sourcefn close(&mut self) -> Result<(), CompressorError>
fn close(&mut self) -> Result<(), CompressorError>
Closes the compressor.