pub struct Inflater { /* private fields */ }Expand description
An incremental DEFLATE decompressor.
Feed bytes with Inflater::feed, drain output with
Inflater::take_output, and call Inflater::end_of_input when the
stream is over. Output beyond the configured limit is a malformed-input
error, never an allocation.
Implementations§
Source§impl Inflater
impl Inflater
Sourcepub const fn end_of_input(&mut self)
pub const fn end_of_input(&mut self)
Declare that no further compressed bytes will arrive.
Sourcepub const fn is_finished(&self) -> bool
pub const fn is_finished(&self) -> bool
Whether the final block has been decoded.
Sourcepub fn retained(&self) -> usize
pub fn retained(&self) -> usize
How many output bytes are currently held — history plus undrained.
Exposed so callers can assert the streaming guarantee rather than trust it: a drained inflater retains the 32 KiB window and no more.
Sourcepub fn take_output(&mut self) -> Vec<u8> ⓘ
pub fn take_output(&mut self) -> Vec<u8> ⓘ
Take everything decoded since the last call.
Draining is what bounds memory: the decompressor keeps only the 32 KiB of history that back-references can still reach, so a caller that drains regularly holds a fixed amount regardless of stream length.