Struct zstd::stream::write::Decoder [−][src]
pub struct Decoder<'a, W: Write> { /* fields omitted */ }
Expand description
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
pub fn with_prepared_dictionary<'b>(
writer: W,
dictionary: &DecoderDictionary<'b>
) -> Result<Self> where
'b: 'a,
pub fn with_prepared_dictionary<'b>(
writer: W,
dictionary: &DecoderDictionary<'b>
) -> Result<Self> where
'b: 'a,
Creates a new decoder, using an existing prepared DecoderDictionary
.
(Provides better compression ratio for small files, but requires the dictionary to be present during decompression.)
Acquires 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.
Returns the inner Write
.
Return a recommendation for the size of data to write at once.
pub fn auto_flush(self) -> AutoFlushDecoder<'a, W>ⓘNotable traits for AutoFlushDecoder<'_, W, F>impl<W: Write, F: FnMut(Result<()>)> Write for AutoFlushDecoder<'_, W, F>
pub fn auto_flush(self) -> AutoFlushDecoder<'a, W>ⓘNotable traits for AutoFlushDecoder<'_, W, F>impl<W: Write, F: FnMut(Result<()>)> Write for AutoFlushDecoder<'_, W, F>
impl<W: Write, F: FnMut(Result<()>)> Write for AutoFlushDecoder<'_, W, F>
Returns a wrapper around self
that will flush the stream on drop.
Panic
Panics on drop if an error happens when flushing the stream.
pub fn on_flush<F: FnMut(Result<()>)>(self, f: F) -> AutoFlushDecoder<'a, W, F>ⓘNotable traits for AutoFlushDecoder<'_, W, F>impl<W: Write, F: FnMut(Result<()>)> Write for AutoFlushDecoder<'_, W, F>
pub fn on_flush<F: FnMut(Result<()>)>(self, f: F) -> AutoFlushDecoder<'a, W, F>ⓘNotable traits for AutoFlushDecoder<'_, W, F>impl<W: Write, F: FnMut(Result<()>)> Write for AutoFlushDecoder<'_, W, F>
impl<W: Write, F: FnMut(Result<()>)> Write for AutoFlushDecoder<'_, W, F>
Returns a decoder that will flush the stream on drop.
Calls the given callback with the result from flush()
.
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.
Trait Implementations
Write a buffer into this writer, returning how many bytes were written. Read more
Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more
can_vector
)Determines if this Write
r has an efficient write_vectored
implementation. Read more
Attempts to write an entire buffer into this writer. Read more
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Writes a formatted string into this writer, returning any error encountered. Read more