Struct zstd::stream::read::Encoder[][src]

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

An encoder that compress input data from another Read.

Implementations

Creates a new encoder.

Creates a new encoder around a BufRead.

Creates a new encoder, using an existing dictionary.

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

Creates a new encoder, using an existing EncoderDictionary.

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 encoder 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 the given zstd compression parameter.

Controls whether zstd should include a content checksum at the end of each frame.

Enables multithreaded compression

  • If n_workers == 0 (default), then multithreaded will be disabled.
  • If n_workers >= 1, then compression will be done in separate threads.

So even n_workers = 1 may increase performance by separating IO and compression.

Enables or disables storing of the dict id.

Defaults to true. If false, the behaviour of decoding with a wrong dictionary is undefined.

Enables or disabled storing of the contentsize

Enables or disables long-distance matching

Sets the maximum back-reference distance.

The actual maximum distance is going to be 2^log_distance.

Enables or disable the magic bytes at the beginning of each frame.

If disabled, include_magicbytes must also be called on the decoder.

Only available with the experimental feature.

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

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

Determines if this Reader can work with buffers of uninitialized memory. 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

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 adaptor which will chain this stream with another. Read more

Creates an adaptor 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

Performs the conversion.

Performs the conversion.

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.