Skip to main content

Oodle

Struct Oodle 

Source
pub struct Oodle { /* private fields */ }
Expand description

Oodle compression library loaded at runtime.

Implementations§

Source§

impl Oodle

Source

pub fn load(path: impl AsRef<OsStr>) -> Result<Self, Error>

Load the Oodle shared library from the given path.

Source

pub fn compress( &self, compressor: OodleCompressor, level: OodleCompressionLevel, input: &[u8], output: &mut [u8], ) -> Result<usize, Error>

Compress input into output using the given compressor and level.

Returns the number of bytes written to output.

Source

pub fn decompress(&self, source: &[u8], dest: &mut [u8]) -> Result<usize, Error>

Decompress source into dest with default options.

Returns the number of decompressed bytes written to dest.

Source

pub fn decompress_with_options( &self, source: &[u8], dest: &mut [u8], fuzz_safe: OodleFuzzSafe, check_crc: OodleCheckCrc, verbosity: OodleVerbosity, thread_phase: OodleDecodeThreadPhase, ) -> Result<usize, Error>

Decompress source into dest with explicit options.

Returns the number of decompressed bytes written to dest.

Source

pub fn get_compressed_buffer_size_needed( &self, compressor: OodleCompressor, raw_size: usize, ) -> usize

Returns the buffer size needed to hold the compressed output for the given compressor and raw data size.

Source

pub fn get_decode_buffer_size( &self, compressor: OodleCompressor, raw_size: usize, corruption_possible: bool, ) -> usize

Returns the buffer size needed for decompression, optionally accounting for possible data corruption.

Source

pub fn get_compress_scratch_mem_bound( &self, compressor: OodleCompressor, level: OodleCompressionLevel, raw_len: usize, ) -> usize

Returns the scratch memory size bound needed for compression.

Trait Implementations§

Source§

impl Debug for Oodle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Oodle

§

impl RefUnwindSafe for Oodle

§

impl Send for Oodle

§

impl Sync for Oodle

§

impl Unpin for Oodle

§

impl UnwindSafe for Oodle

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.