pub struct BundleCompression;Expand description
Bundle compression handler
This struct provides methods for handling compressed bundle data, including block info decompression and data block processing.
Implementations§
Source§impl BundleCompression
impl BundleCompression
Sourcepub fn decompress_blocks_info(
header: &BundleHeader,
compressed_data: &[u8],
) -> Result<Vec<u8>, BinaryError>
pub fn decompress_blocks_info( header: &BundleHeader, compressed_data: &[u8], ) -> Result<Vec<u8>, BinaryError>
Decompress blocks info data
This method handles the decompression of the blocks information section of a bundle, which contains metadata about all compression blocks.
pub fn decompress_blocks_info_limited( header: &BundleHeader, compressed_data: &[u8], max_uncompressed_size: Option<usize>, ) -> Result<Vec<u8>, BinaryError>
Sourcepub fn parse_compression_blocks(
data: &[u8],
) -> Result<Vec<CompressionBlock>, BinaryError>
pub fn parse_compression_blocks( data: &[u8], ) -> Result<Vec<CompressionBlock>, BinaryError>
Parse compression blocks from decompressed blocks info
This method parses the compression block metadata from the decompressed blocks info data.
pub fn parse_compression_blocks_limited( data: &[u8], options: &BundleLoadOptions, ) -> Result<Vec<CompressionBlock>, BinaryError>
Sourcepub fn decompress_data_blocks(
header: &BundleHeader,
blocks: &[CompressionBlock],
reader: &mut BinaryReader<'_>,
) -> Result<Vec<u8>, BinaryError>
pub fn decompress_data_blocks( header: &BundleHeader, blocks: &[CompressionBlock], reader: &mut BinaryReader<'_>, ) -> Result<Vec<u8>, BinaryError>
Decompress all data blocks
This method reads and decompresses all data blocks from the bundle, returning the complete decompressed data.
pub fn decompress_data_blocks_limited( header: &BundleHeader, blocks: &[CompressionBlock], reader: &mut BinaryReader<'_>, max_memory: Option<usize>, ) -> Result<Vec<u8>, BinaryError>
Sourcepub fn get_compression_stats(blocks: &[CompressionBlock]) -> CompressionStats
pub fn get_compression_stats(blocks: &[CompressionBlock]) -> CompressionStats
Get compression statistics for blocks
Sourcepub fn validate_blocks(blocks: &[CompressionBlock]) -> Result<(), BinaryError>
pub fn validate_blocks(blocks: &[CompressionBlock]) -> Result<(), BinaryError>
Validate compression blocks
Sourcepub fn estimate_memory_usage(blocks: &[CompressionBlock]) -> usize
pub fn estimate_memory_usage(blocks: &[CompressionBlock]) -> usize
Estimate memory usage for decompression
Sourcepub fn is_compression_supported(compression_type: u32) -> bool
pub fn is_compression_supported(compression_type: u32) -> bool
Check if compression type is supported
Auto Trait Implementations§
impl Freeze for BundleCompression
impl RefUnwindSafe for BundleCompression
impl Send for BundleCompression
impl Sync for BundleCompression
impl Unpin for BundleCompression
impl UnwindSafe for BundleCompression
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