pub struct CompressionEngine { /* private fields */ }Expand description
Compression engine that handles all compression algorithms
Implementations§
Source§impl CompressionEngine
impl CompressionEngine
Sourcepub fn compress(
&mut self,
data: &[u8],
algorithm: CompressionAlgorithm,
block_id: &BlockId,
block_type: BlockType,
) -> SparseResult<CompressionResult>
pub fn compress( &mut self, data: &[u8], algorithm: CompressionAlgorithm, block_id: &BlockId, block_type: BlockType, ) -> SparseResult<CompressionResult>
Compress data using the specified algorithm
Sourcepub fn decompress(
&mut self,
compressed_data: &[u8],
algorithm: CompressionAlgorithm,
original_size: usize,
) -> SparseResult<Vec<u8>>
pub fn decompress( &mut self, compressed_data: &[u8], algorithm: CompressionAlgorithm, original_size: usize, ) -> SparseResult<Vec<u8>>
Decompress data using the specified algorithm
Sourcepub fn get_algorithm_metrics(
&self,
algorithm: CompressionAlgorithm,
) -> Option<&AlgorithmMetrics>
pub fn get_algorithm_metrics( &self, algorithm: CompressionAlgorithm, ) -> Option<&AlgorithmMetrics>
Get algorithm performance metrics
Sourcepub fn select_best_algorithm(
&self,
data_size: usize,
block_type: BlockType,
) -> CompressionAlgorithm
pub fn select_best_algorithm( &self, data_size: usize, block_type: BlockType, ) -> CompressionAlgorithm
Get best algorithm for given data characteristics
Trait Implementations§
Source§impl Debug for CompressionEngine
impl Debug for CompressionEngine
Auto Trait Implementations§
impl Freeze for CompressionEngine
impl RefUnwindSafe for CompressionEngine
impl Send for CompressionEngine
impl Sync for CompressionEngine
impl Unpin for CompressionEngine
impl UnwindSafe for CompressionEngine
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more