Struct Decoder
struct Decoder<'a, W: Write> { ... }
A decoder that decompress and forward data to another writer.
Note that you probably want to flush() after writing your stream content.
You can use auto_flush() to automatically flush the writer on drop.
Implementations
impl<'a, W: Write> Decoder<'a, W>
fn with_writer(writer: Writer<W, Decoder<'a>>) -> SelfCreates a new decoder around the given prepared zio writer.
Examples
fn with_decoder(writer: W, decoder: Decoder<'a>) -> SelfCreates a new decoder around the given
Writeand raw decoder.fn with_prepared_dictionary<'b>(writer: W, dictionary: &DecoderDictionary<'b>) -> Result<Self> where 'b: 'aCreates a new decoder, using an existing prepared
DecoderDictionary.(Provides better compression ratio for small files, but requires the dictionary to be present during decompression.)
fn get_ref(self: &Self) -> &WAcquires a reference to the underlying writer.
fn get_mut(self: &mut Self) -> &mut WAcquires a mutable reference to the underlying writer.
Note that mutation of the writer may result in surprising results if this decoder is continued to be used.
fn into_inner(self: Self) -> WReturns the inner
Write.fn recommended_input_size() -> usizeReturn a recommendation for the size of data to write at once.
fn auto_flush(self: Self) -> AutoFlushDecoder<'a, W>Returns a wrapper around
selfthat will flush the stream on drop.fn on_flush<F: FnMut(io::Result<()>)>(self: Self, f: F) -> AutoFlushDecoder<'a, W, F>Returns a decoder that will flush the stream on drop.
Calls the given callback with the result from
flush(). This runs during drop so it's important that the provided callback doesn't panic.fn set_parameter(self: &mut Self, parameter: DParameter) -> Result<()>Sets a decompression parameter on the decompression stream.
fn window_log_max(self: &mut Self, log_distance: u32) -> Result<()>Sets the maximum back-reference distance.
The actual maximum distance is going to be
2^log_distance.This will need to at least match the value set when compressing.
impl<W: Write> Decoder<'static, W>
fn new(writer: W) -> Result<Self>Creates a new decoder.
fn with_dictionary(writer: W, dictionary: &[u8]) -> Result<Self>Creates a new decoder, using an existing dictionary.
(Provides better compression ratio for small files, but requires the dictionary to be present during decompression.)
impl<'a, W> Freeze for Decoder<'a, W>
impl<'a, W> RefUnwindSafe for Decoder<'a, W>
impl<'a, W> Send for Decoder<'a, W>
impl<'a, W> Sync for Decoder<'a, W>
impl<'a, W> Unpin for Decoder<'a, W>
impl<'a, W> UnsafeUnpin for Decoder<'a, W>
impl<'a, W> UnwindSafe for Decoder<'a, W>
impl<T> Any for Decoder<'a, W>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Decoder<'a, W>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Decoder<'a, W>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for Decoder<'a, W>
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into for Decoder<'a, W>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Decoder<'a, W>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Decoder<'a, W>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<W: Write> Write for Decoder<'_, W>
fn write(self: &mut Self, buf: &[u8]) -> Result<usize>fn flush(self: &mut Self) -> Result<()>