pub struct CompressionBlock {
pub uncompressed_size: u32,
pub compressed_size: u32,
pub flags: u16,
}Expand description
Compression block information
Fields§
§uncompressed_size: u32Uncompressed size of the block
compressed_size: u32Compressed size of the block
flags: u16Compression flags
Implementations§
Source§impl CompressionBlock
impl CompressionBlock
Sourcepub fn new(
uncompressed_size: u32,
compressed_size: u32,
flags: u16,
) -> CompressionBlock
pub fn new( uncompressed_size: u32, compressed_size: u32, flags: u16, ) -> CompressionBlock
Create a new compression block
Sourcepub fn compression_type(&self) -> Result<CompressionType, BinaryError>
pub fn compression_type(&self) -> Result<CompressionType, BinaryError>
Get the compression type for this block
Sourcepub fn is_compressed(&self) -> bool
pub fn is_compressed(&self) -> bool
Check if this block is compressed
Sourcepub fn decompress(&self, data: &[u8]) -> Result<Vec<u8>, BinaryError>
pub fn decompress(&self, data: &[u8]) -> Result<Vec<u8>, BinaryError>
Decompress the block data
Trait Implementations§
Source§impl Clone for CompressionBlock
impl Clone for CompressionBlock
Source§fn clone(&self) -> CompressionBlock
fn clone(&self) -> CompressionBlock
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CompressionBlock
impl RefUnwindSafe for CompressionBlock
impl Send for CompressionBlock
impl Sync for CompressionBlock
impl Unpin for CompressionBlock
impl UnwindSafe for CompressionBlock
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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