pub trait DecodeV2 {
// Required methods
fn reinit(&mut self) -> Result<()>;
fn decode(
&mut self,
input: &mut PartialBuffer<&[u8]>,
output: &mut WriteBuffer<'_>,
) -> Result<bool>;
fn flush(&mut self, output: &mut WriteBuffer<'_>) -> Result<bool>;
fn finish(&mut self, output: &mut WriteBuffer<'_>) -> Result<bool>;
}Expand description
version 2 Decode that is trait object safe.
The different from Decode is that:
- It doesn’t have any generic in it, so it is trait object safe
- It uses
WriteBufferfor output, which will support uninitialized buffer.
Required Methods§
Sourcefn reinit(&mut self) -> Result<()>
fn reinit(&mut self) -> Result<()>
Reinitializes this decoder ready to decode a new member/frame of data.
Sourcefn decode(
&mut self,
input: &mut PartialBuffer<&[u8]>,
output: &mut WriteBuffer<'_>,
) -> Result<bool>
fn decode( &mut self, input: &mut PartialBuffer<&[u8]>, output: &mut WriteBuffer<'_>, ) -> Result<bool>
Returns whether the end of the stream has been read
Sourcefn flush(&mut self, output: &mut WriteBuffer<'_>) -> Result<bool>
fn flush(&mut self, output: &mut WriteBuffer<'_>) -> Result<bool>
Returns whether the internal buffers are flushed
Sourcefn finish(&mut self, output: &mut WriteBuffer<'_>) -> Result<bool>
fn finish(&mut self, output: &mut WriteBuffer<'_>) -> Result<bool>
Returns whether the internal buffers are flushed
Implementors§
impl DecodeV2 for BrotliDecoder
Available on crate feature
brotli only.impl DecodeV2 for BzDecoder
Available on crate feature
bzip2 only.impl DecodeV2 for Deflate64Decoder
Available on crate feature
deflate64 only.impl DecodeV2 for DeflateDecoder
Available on crate feature
deflate only.impl DecodeV2 for FlateDecoder
Available on crate feature
flate2 only.impl DecodeV2 for GzipDecoder
Available on crate feature
gzip only.impl DecodeV2 for Lz4Decoder
Available on crate feature
lz4 only.impl DecodeV2 for LzmaDecoder
Available on crate feature
lzma only.impl DecodeV2 for Xz2Decoder
Available on crate feature
lzma only.impl DecodeV2 for XzDecoder
Available on crate feature
xz only.impl DecodeV2 for ZlibDecoder
Available on crate feature
zlib only.impl DecodeV2 for ZstdDecoder
Available on crate feature
zstd only.