pub struct CompressorOxide { /* private fields */ }
Expand description
Main compression struct.
Implementations§
source§impl CompressorOxide
impl CompressorOxide
sourcepub fn new(flags: u32) -> Self
pub fn new(flags: u32) -> Self
Create a new CompressorOxide
with the given flags.
§Notes
This function may be changed to take different parameters in the future.
sourcepub const fn prev_return_status(&self) -> TDEFLStatus
pub const fn prev_return_status(&self) -> TDEFLStatus
Get the return status of the previous compress
call with this compressor.
sourcepub const fn flags(&self) -> i32
pub const fn flags(&self) -> i32
Get the raw compressor flags.
§Notes
This function may be deprecated or changed in the future to use more rust-style flags.
sourcepub const fn data_format(&self) -> DataFormat
pub const fn data_format(&self) -> DataFormat
Returns whether the compressor is wrapping the data in a zlib format or not.
sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset the state of the compressor, keeping the same parameters.
This avoids re-allocating data.
sourcepub fn set_compression_level(&mut self, level: CompressionLevel)
pub fn set_compression_level(&mut self, level: CompressionLevel)
Set the compression level of the compressor.
Using this to change level after compression has started is supported.
§Notes
The compression strategy will be reset to the default one when this is called.
sourcepub fn set_compression_level_raw(&mut self, level: u8)
pub fn set_compression_level_raw(&mut self, level: u8)
Set the compression level of the compressor using an integer value.
Using this to change level after compression has started is supported.
§Notes
The compression strategy will be reset to the default one when this is called.
sourcepub fn set_format_and_level(&mut self, data_format: DataFormat, level: u8)
pub fn set_format_and_level(&mut self, data_format: DataFormat, level: u8)
Update the compression settings of the compressor.
Changing the DataFormat
after compression has started will result in
a corrupted stream.
§Notes
This function mainly intended for setting the initial settings after e.g creating with
default
or after calling CompressorOxide::reset()
, and behaviour may be changed
to disallow calling it after starting compression in the future.