Struct object::read::CompressedData
source · pub struct CompressedData<'data> {
pub format: CompressionFormat,
pub data: &'data [u8],
pub uncompressed_size: u64,
}
Expand description
Data that may be compressed.
Returned by ObjectSection::compressed_data
.
Fields§
§format: CompressionFormat
The data compression format.
data: &'data [u8]
The compressed data.
uncompressed_size: u64
The uncompressed data size.
Implementations§
source§impl<'data> CompressedData<'data>
impl<'data> CompressedData<'data>
sourcepub fn decompress(self) -> Result<Cow<'data, [u8]>>
pub fn decompress(self) -> Result<Cow<'data, [u8]>>
Return the uncompressed data.
Returns an error for invalid data or unsupported compression.
This includes if the data is compressed but the compression
feature
for this crate is disabled.
Trait Implementations§
source§impl<'data> Clone for CompressedData<'data>
impl<'data> Clone for CompressedData<'data>
source§fn clone(&self) -> CompressedData<'data>
fn clone(&self) -> CompressedData<'data>
Returns a copy 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 moresource§impl<'data> Debug for CompressedData<'data>
impl<'data> Debug for CompressedData<'data>
source§impl<'data> Hash for CompressedData<'data>
impl<'data> Hash for CompressedData<'data>
source§impl<'data> PartialEq for CompressedData<'data>
impl<'data> PartialEq for CompressedData<'data>
source§fn eq(&self, other: &CompressedData<'data>) -> bool
fn eq(&self, other: &CompressedData<'data>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'data> Copy for CompressedData<'data>
impl<'data> Eq for CompressedData<'data>
impl<'data> StructuralPartialEq for CompressedData<'data>
Auto Trait Implementations§
impl<'data> Freeze for CompressedData<'data>
impl<'data> RefUnwindSafe for CompressedData<'data>
impl<'data> Send for CompressedData<'data>
impl<'data> Sync for CompressedData<'data>
impl<'data> Unpin for CompressedData<'data>
impl<'data> UnwindSafe for CompressedData<'data>
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