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>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.