#[repr(C)]pub struct CompressionHeader {
pub ch_type: u32,
pub ch_reserved: u32,
pub ch_size: u64,
pub ch_addralign: u64,
}
Expand description
The compression header is used at the start of SHF_COMPRESSED sections
Fields
ch_type: u32
Compression format
ch_reserved: u32
ch_size: u64
Uncompressed data size
ch_addralign: u64
Uncompressed data alignment
Implementations
sourceimpl CompressionHeader
impl CompressionHeader
pub fn from_bytes(bytes: &[u8]) -> CompressionHeader
pub fn from_fd(fd: &mut File, offset: u64) -> Result<CompressionHeader>
Trait Implementations
sourceimpl Clone for CompressionHeader
impl Clone for CompressionHeader
sourcefn clone(&self) -> CompressionHeader
fn clone(&self) -> CompressionHeader
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for CompressionHeader
impl Debug for CompressionHeader
sourceimpl Default for CompressionHeader
impl Default for CompressionHeader
sourcefn default() -> CompressionHeader
fn default() -> CompressionHeader
Returns the “default value” for a type. Read more
sourceimpl From<CompressionHeader> for ElfCompressionHeader
impl From<CompressionHeader> for ElfCompressionHeader
sourcefn from(ch: CompressionHeader) -> Self
fn from(ch: CompressionHeader) -> Self
Performs the conversion.
sourceimpl From<CompressionHeader> for CompressionHeader
impl From<CompressionHeader> for CompressionHeader
sourcefn from(ch: ElfCompressionHeader) -> Self
fn from(ch: ElfCompressionHeader) -> Self
Performs the conversion.
sourceimpl PartialEq<CompressionHeader> for CompressionHeader
impl PartialEq<CompressionHeader> for CompressionHeader
sourcefn eq(&self, other: &CompressionHeader) -> bool
fn eq(&self, other: &CompressionHeader) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &CompressionHeader) -> bool
fn ne(&self, other: &CompressionHeader) -> bool
This method tests for !=
.
sourceimpl Plain for CompressionHeader
impl Plain for CompressionHeader
fn from_bytes(bytes: &[u8]) -> Result<&Self, Error>
fn slice_from_bytes(bytes: &[u8]) -> Result<&[Self], Error>
fn slice_from_bytes_len(bytes: &[u8], len: usize) -> Result<&[Self], Error>
fn from_mut_bytes(bytes: &mut [u8]) -> Result<&mut Self, Error>
fn slice_from_mut_bytes(bytes: &mut [u8]) -> Result<&mut [Self], Error>
fn slice_from_mut_bytes_len(
bytes: &mut [u8],
len: usize
) -> Result<&mut [Self], Error>
fn copy_from_bytes(&mut self, bytes: &[u8]) -> Result<(), Error>
sourceimpl<'a> TryFromCtx<'a, Endian, [u8]> for CompressionHeader where
CompressionHeader: 'a,
impl<'a> TryFromCtx<'a, Endian, [u8]> for CompressionHeader where
CompressionHeader: 'a,
sourceimpl<'a> TryIntoCtx<Endian, [u8]> for &'a CompressionHeader
impl<'a> TryIntoCtx<Endian, [u8]> for &'a CompressionHeader
sourceimpl TryIntoCtx<Endian, [u8]> for CompressionHeader
impl TryIntoCtx<Endian, [u8]> for CompressionHeader
impl Copy for CompressionHeader
impl Eq for CompressionHeader
impl StructuralEq for CompressionHeader
impl StructuralPartialEq for CompressionHeader
Auto Trait Implementations
impl RefUnwindSafe for CompressionHeader
impl Send for CompressionHeader
impl Sync for CompressionHeader
impl Unpin for CompressionHeader
impl UnwindSafe for CompressionHeader
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more