pub struct ExplodeBuffer<'a> { /* private fields */ }
Expand description
A handle to feed input to the decompressor.
This is the primary interface for low-level decompression. You can
get an instance of this by providing an output buffer to
Explode::with_buffer
.
For a high-level example of how to use this interface, see
Explode
.
Implementations§
Source§impl<'a> ExplodeBuffer<'a>
impl<'a> ExplodeBuffer<'a>
Sourcepub fn feed(&mut self, input: u8) -> Result<()>
pub fn feed(&mut self, input: u8) -> Result<()>
Feed in a byte input
to decompress.
Signals a full output buffer by returning Ok(())
. You can
then get a reference to the full buffer with
get
, and reset the output buffer to empty
with reset
.
Note that you should feed in the same byte repeatedly to
this function, until it signals it is ready for more input by
returning
Error::IncompleteInput
.
Doing anything else will result in a decompression failure or
bad output.
Sourcepub fn get(&self) -> &[u8] ⓘ
pub fn get(&self) -> &[u8] ⓘ
Get a reference to the filled portion of the output buffer.
This is usually called after feed
returns Ok(())
.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset the output buffer to empty.
Note that this does not reset the entire decompressor state.
Sourcepub fn done(&self) -> bool
pub fn done(&self) -> bool
Returns true if decompression is finished.
This does the same thing as
Explode::done
but is
usable while a ExplodeBuffer
is still in scope.