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 around a BufRead
.
pub fn with_prepared_dictionary<'b>(
reader: R,
dictionary: &EncoderDictionary<'b>
) -> Result<Self> where
'b: 'a,
pub fn with_prepared_dictionary<'b>(
reader: R,
dictionary: &EncoderDictionary<'b>
) -> Result<Self> where
'b: 'a,
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 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.
Sets the expected size of the input.
This affects the compression effectiveness.
It is an error to give an incorrect size (an error will be returned when closing the stream if the size does not match what was pledged).
Giving a None
size means the size is unknown (this is the default).
Controls whether zstd should include a content checksum at the end of each frame.
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.
Note that this only has an effect if the size is given with set_pledged_src_size
.
Enables or disables long-distance matching
Sets the maximum back-reference distance.
The actual maximum distance is going to be 2^log_distance
.
Note that decompression will need to use at least the same setting.
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
can_vector
)Determines if this Read
er 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
read_buf
)Pull some bytes from this source into the specified buffer. Read more
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
Creates an adapter which will chain this stream with another. Read more