pub struct Decoder<'a, R: BufRead> { /* private fields */ }
Expand description

A decoder that decompress input data from another Read.

This allows to read a stream of compressed data (good for files or heavy network stream).

Implementations

Creates a new decoder.

Creates a new decoder around a BufRead.

Creates a new decoder, using an existing dictionary.

The dictionary must be the same as the one used during compression.

Sets this Decoder to stop after the first frame.

By default, it keeps concatenating frames until EOF is reached.

Creates a new decoder, using an existing DecoderDictionary.

The dictionary must be the same as the one used during compression.

Recommendation for the size of the output buffer.

Acquire a reference to the underlying reader.

Acquire a mutable reference to the underlying reader.

Note that mutation of the reader may result in surprising results if this decoder is continued to be used.

Return the inner Read.

Calling finish() is not required after reading a stream - just use it if you need to get the Read back.

Sets a decompression parameter on the decompression stream.

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.

Available on crate feature experimental only.

Enables or disabled expecting the 4-byte magic header

Only available with the experimental feature.

This will need to match the settings used when compressing.

Trait Implementations

Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more

Like read, except that it reads into a slice of buffers. Read more

🔬 This is a nightly-only experimental API. (can_vector)

Determines if this Reader has an efficient read_vectored implementation. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read all bytes until EOF in this source, appending them to buf. Read more

Read the exact number of bytes required to fill buf. Read more

🔬 This is a nightly-only experimental API. (read_buf)

Pull some bytes from this source into the specified buffer. Read more

🔬 This is a nightly-only experimental API. (read_buf)

Read the exact number of bytes required to fill buf. Read more

Creates a “by reference” adaptor for this instance of Read. Read more

Transforms this Read instance to an Iterator over its bytes. Read more

Creates an adapter which will chain this stream with another. Read more

Creates an adapter which will read at most limit bytes from it. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.