Struct miniz_oxide::deflate::core::CompressorOxide
source · [−]pub struct CompressorOxide { /* private fields */ }
Expand description
Main compression struct.
Implementations
sourceimpl 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 fn prev_return_status(&self) -> TDEFLStatus
pub fn prev_return_status(&self) -> TDEFLStatus
Get the return status of the previous compress
call with this compressor.
sourcepub fn flags(&self) -> i32
pub 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 fn data_format(&self) -> DataFormat
pub 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 compresson 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 compresson 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 intented 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.
Trait Implementations
sourceimpl Default for CompressorOxide
impl Default for CompressorOxide
Auto Trait Implementations
impl RefUnwindSafe for CompressorOxide
impl Send for CompressorOxide
impl Sync for CompressorOxide
impl Unpin for CompressorOxide
impl UnwindSafe for CompressorOxide
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more