pub struct Decoder(/* private fields */);
Expand description
Stateful context for decompression.
See the crate level decompression section for detailed usage.
Implementations§
source§impl Decoder
impl Decoder
sourcepub fn set_format(&mut self, format: Format)
pub fn set_format(&mut self, format: Format)
Sets the expected format of the input data for the next usage of the decoder.
sourcepub fn stream<'a, W: Write>(
&'a mut self,
writer: &'a mut W
) -> DecoderStream<'a, impl Sink + 'a> ⓘ
pub fn stream<'a, W: Write>( &'a mut self, writer: &'a mut W ) -> DecoderStream<'a, impl Sink + 'a> ⓘ
Creates a decoder stream that will write into the specified writer.
sourcepub fn stream_into_vec<'a>(
&'a mut self,
vec: &'a mut Vec<u8>
) -> DecoderStream<'a, impl Sink + 'a> ⓘ
pub fn stream_into_vec<'a>( &'a mut self, vec: &'a mut Vec<u8> ) -> DecoderStream<'a, impl Sink + 'a> ⓘ
Creates a decoder stream that will write into the specified vector. The resulting stream will not clear the vector but will instead append the decompressed data.
sourcepub fn stream_into_buf<'a>(
&'a mut self,
buf: &'a mut [u8]
) -> DecoderStream<'a, impl Sink + 'a> ⓘ
pub fn stream_into_buf<'a>( &'a mut self, buf: &'a mut [u8] ) -> DecoderStream<'a, impl Sink + 'a> ⓘ
Creates a decoder stream that will write into the specified buffer. The stream will generate an overflow error if the buffer is not large enough to contain the decompressed data.
Auto Trait Implementations§
impl RefUnwindSafe for Decoder
impl Send for Decoder
impl Sync for Decoder
impl Unpin for Decoder
impl UnwindSafe for Decoder
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