Struct CompressorOxide

struct CompressorOxide { ... }

Main compression struct.

Implementations

impl CompressorOxide

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.

const fn adler32(self: &Self) -> u32

Get the adler32 checksum of the currently encoded data.

const fn prev_return_status(self: &Self) -> TDEFLStatus

Get the return status of the previous compress call with this compressor.

const fn flags(self: &Self) -> i32

Get the raw compressor flags.

Notes

This function may be deprecated or changed in the future to use more rust-style flags.

const fn data_format(self: &Self) -> DataFormat

Returns whether the compressor is wrapping the data in a zlib format or not.

fn reset(self: &mut Self)

Reset the state of the compressor, keeping the same parameters.

This avoids re-allocating data.

fn set_compression_level(self: &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.

fn set_compression_level_raw(self: &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.

fn set_format_and_level(self: &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.

impl Default for CompressorOxide

fn default() -> Self

Initialize the compressor with a level of 4, zlib wrapper and the default strategy.

impl Freeze for CompressorOxide

impl RefUnwindSafe for CompressorOxide

impl Send for CompressorOxide

impl Sync for CompressorOxide

impl Unpin for CompressorOxide

impl UnsafeUnpin for CompressorOxide

impl UnwindSafe for CompressorOxide

impl<T> Any for CompressorOxide

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for CompressorOxide

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for CompressorOxide

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> From for CompressorOxide

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into for CompressorOxide

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for CompressorOxide

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for CompressorOxide

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>