pub struct Zlib {}Expand description
Zlib deflate stream with zlib header and footer.
Trait Implementations§
Source§impl FormatSpec for Zlib
Available on crate feature any_zlib only.
impl FormatSpec for Zlib
Available on crate feature
any_zlib only.type Compressor = Compress
Source§fn create_compressor(
&self,
compression_level: Compression,
) -> Result<Self::Compressor, GzpError>
fn create_compressor( &self, compression_level: Compression, ) -> Result<Self::Compressor, GzpError>
Create a thread local compressor
Source§fn needs_dict(&self) -> bool
fn needs_dict(&self) -> bool
Whether or not this format should try to use a dictionary.
Source§fn encode(
&self,
input: &[u8],
encoder: &mut Self::Compressor,
_compression_level: Compression,
dict: Option<&Bytes>,
is_last: bool,
) -> Result<Vec<u8>, GzpError>
fn encode( &self, input: &[u8], encoder: &mut Self::Compressor, _compression_level: Compression, dict: Option<&Bytes>, is_last: bool, ) -> Result<Vec<u8>, GzpError>
How to deflate bytes for this format. Returns deflated bytes.
Source§fn header(&self, compression_level: Compression) -> Vec<u8> ⓘ
fn header(&self, compression_level: Compression) -> Vec<u8> ⓘ
Generate a generic header for the given format.
Generate a genric footer for the format.
Source§const DEFAULT_BUFSIZE: usize = 131_072usize
const DEFAULT_BUFSIZE: usize = 131_072usize
The default buffersize to use for this format
Source§fn create_check() -> Self::C
fn create_check() -> Self::C
Create a check value for this format that implements
CheckSource§impl<W> SyncWriter<W> for Zlibwhere
W: Write,
Available on crate feature any_zlib only.
impl<W> SyncWriter<W> for Zlibwhere
W: Write,
Available on crate feature
any_zlib only.type OutputWriter = ZlibEncoder<W>
fn sync_writer(writer: W, compression_level: Compression) -> ZlibEncoder<W>
impl Copy for Zlib
Auto Trait Implementations§
impl Freeze for Zlib
impl RefUnwindSafe for Zlib
impl Send for Zlib
impl Sync for Zlib
impl Unpin for Zlib
impl UnwindSafe for Zlib
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more