pub struct InflateState {
    decomp: DecompressorOxide,
    dict: [u8; 32768],
    dict_ofs: usize,
    dict_avail: usize,
    first_call: bool,
    has_flushed: bool,
    data_format: DataFormat,
    last_status: TINFLStatus,
}Expand description
A struct that compbines a decompressor with extra data for streaming decompression.
Fields§
§decomp: DecompressorOxideInner decompressor struct
dict: [u8; 32768]Buffer of input bytes for matches. TODO: Could probably do this a bit cleaner with some Cursor-like class. We may also look into whether we need to keep a buffer here, or just one in the decompressor struct.
dict_ofs: usizeWhere in the buffer are we currently at?
dict_avail: usizeHow many bytes of data to be flushed is there currently in the buffer?
first_call: bool§has_flushed: bool§data_format: DataFormatWhether the input data is wrapped in a zlib header and checksum. TODO: This should be stored in the decompressor.
last_status: TINFLStatusImplementations§
Source§impl InflateState
 
impl InflateState
Sourcepub fn new(data_format: DataFormat) -> InflateState
 
pub fn new(data_format: DataFormat) -> InflateState
Create a new state.
Note that this struct is quite large due to internal buffers, and as such storing it on the stack is not recommended.
§Parameters
data_format: Determines whether the compressed data is assumed to wrapped with zlib
metadata.
Sourcepub fn new_boxed(data_format: DataFormat) -> Box<InflateState>
 
pub fn new_boxed(data_format: DataFormat) -> Box<InflateState>
Create a new state on the heap.
§Parameters
data_format: Determines whether the compressed data is assumed to wrapped with zlib
metadata.
Sourcepub fn decompressor(&mut self) -> &mut DecompressorOxide
 
pub fn decompressor(&mut self) -> &mut DecompressorOxide
Access the innner decompressor.
Sourcepub const fn last_status(&self) -> TINFLStatus
 
pub const fn last_status(&self) -> TINFLStatus
Return the status of the last call to inflate with this InflateState.
Sourcepub fn new_boxed_with_window_bits(window_bits: i32) -> Box<InflateState>
 
pub fn new_boxed_with_window_bits(window_bits: i32) -> Box<InflateState>
Create a new state using miniz/zlib style window bits parameter.
The decompressor does not support different window sizes. As such, any positive (>0) value will set the zlib header flag, while a negative one will not.
Sourcepub fn reset(&mut self, data_format: DataFormat)
 
pub fn reset(&mut self, data_format: DataFormat)
Reset the decompressor without re-allocating memory, using the given data format.
Sourcepub fn reset_as<T: ResetPolicy>(&mut self, policy: T)
 
pub fn reset_as<T: ResetPolicy>(&mut self, policy: T)
Resets the state according to specified policy.
Trait Implementations§
Source§impl Clone for InflateState
 
impl Clone for InflateState
Source§fn clone(&self) -> InflateState
 
fn clone(&self) -> InflateState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
source. Read more