Struct zstd::stream::read::Decoder [−][src]
pub struct Decoder<'a, R: BufRead> { /* fields omitted */ }
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
impl<R: BufRead> Decoder<'static, R>
[src]
impl<R: BufRead> Decoder<'static, R>
[src]pub fn with_buffer(reader: R) -> Result<Self>
[src]
pub fn with_buffer(reader: R) -> Result<Self>
[src]Creates a new decoder around a BufRead
.
impl<'a, R: BufRead> Decoder<'a, R>
[src]
impl<'a, R: BufRead> Decoder<'a, R>
[src]pub fn single_frame(self) -> Self
[src]
pub fn single_frame(self) -> Self
[src]Sets this Decoder
to stop after the first frame.
By default, it keeps concatenating frames until EOF is reached.
pub fn with_prepared_dictionary<'b>(
reader: R,
dictionary: &DecoderDictionary<'b>
) -> Result<Self> where
'b: 'a,
[src]
pub fn with_prepared_dictionary<'b>(
reader: R,
dictionary: &DecoderDictionary<'b>
) -> Result<Self> where
'b: 'a,
[src]Creates a new decoder, using an existing DecoderDictionary
.
The dictionary must be the same as the one used during compression.
pub fn recommended_output_size() -> usize
[src]
pub fn recommended_output_size() -> usize
[src]Recommendation for the size of the output buffer.
pub fn include_magicbytes(&mut self, include_magicbytes: bool) -> Result<()>
[src]
pub fn include_magicbytes(&mut self, include_magicbytes: bool) -> Result<()>
[src]Enables or disabled expecting the 4-byte magic header
Only available when using the experimental
feature.
Trait Implementations
impl<R: BufRead> Read for Decoder<'_, R>
[src]
impl<R: BufRead> Read for Decoder<'_, R>
[src]fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
[src]Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
1.36.0[src]
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
1.36.0[src]Like read
, except that it reads into a slice of buffers. Read more
fn is_read_vectored(&self) -> bool
[src]
fn is_read_vectored(&self) -> bool
[src]can_vector
)Determines if this Read
er has an efficient read_vectored
implementation. Read more
unsafe fn initializer(&self) -> Initializer
[src]
unsafe fn initializer(&self) -> Initializer
[src]read_initializer
)Determines if this Read
er can work with buffers of uninitialized
memory. Read more
fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
1.0.0[src]
fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
1.0.0[src]Read all bytes until EOF in this source, placing them into buf
. Read more
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
1.0.0[src]Read all bytes until EOF in this source, appending them to buf
. Read more
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
1.6.0[src]Read the exact number of bytes required to fill buf
. Read more
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]Creates a “by reference” adaptor for this instance of Read
. Read more
Auto Trait Implementations
impl<'a, R> RefUnwindSafe for Decoder<'a, R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<'a, R> Send for Decoder<'a, R> where
R: Send,
R: Send,
impl<'a, R> !Sync for Decoder<'a, R>
impl<'a, R> Unpin for Decoder<'a, R> where
R: Unpin,
R: Unpin,
impl<'a, R> UnwindSafe for Decoder<'a, R> where
R: UnwindSafe,
R: UnwindSafe,