pub struct ProgramHeader {
pub p_type: u32,
pub p_flags: u32,
pub p_offset: u64,
pub p_vaddr: u64,
pub p_paddr: u64,
pub p_filesz: u64,
pub p_memsz: u64,
pub p_align: u64,
}Expand description
A unified ProgramHeader - convertable to and from 32-bit and 64-bit variants
Fields§
§p_type: u32§p_flags: u32§p_offset: u64§p_vaddr: u64§p_paddr: u64§p_filesz: u64§p_memsz: u64§p_align: u64Implementations§
Source§impl ProgramHeader
impl ProgramHeader
Sourcepub fn file_range(&self) -> Range<usize>
pub fn file_range(&self) -> Range<usize>
Returns this program header’s file offset range
Sourcepub fn executable(&mut self)
pub fn executable(&mut self)
Sets the executable flag
Sourcepub fn is_executable(&self) -> bool
pub fn is_executable(&self) -> bool
Whether this program header is executable
pub fn parse( bytes: &[u8], offset: usize, count: usize, ctx: Ctx, ) -> Result<Vec<ProgramHeader>>
Trait Implementations§
Source§impl Clone for ProgramHeader
impl Clone for ProgramHeader
Source§fn clone(&self) -> ProgramHeader
fn clone(&self) -> ProgramHeader
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProgramHeader
Available on crate feature alloc only.
impl Debug for ProgramHeader
Available on crate feature
alloc only.Source§impl Default for ProgramHeader
impl Default for ProgramHeader
Source§fn default() -> ProgramHeader
fn default() -> ProgramHeader
Returns the “default value” for a type. Read more
Source§impl From<ProgramHeader> for ElfProgramHeader
Available on crate feature alloc only.
impl From<ProgramHeader> for ElfProgramHeader
Available on crate feature
alloc only.Source§fn from(ph: ProgramHeader) -> Self
fn from(ph: ProgramHeader) -> Self
Converts to this type from the input type.
Source§impl From<ProgramHeader> for ProgramHeader
Available on crate feature alloc only.
impl From<ProgramHeader> for ProgramHeader
Available on crate feature
alloc only.Source§fn from(ph: ElfProgramHeader) -> Self
fn from(ph: ElfProgramHeader) -> Self
Converts to this type from the input type.
Source§impl From<ProgramHeader> for ElfProgramHeader
Available on crate feature alloc only.
impl From<ProgramHeader> for ElfProgramHeader
Available on crate feature
alloc only.Source§fn from(ph: ProgramHeader) -> Self
fn from(ph: ProgramHeader) -> Self
Converts to this type from the input type.
Source§impl From<ProgramHeader> for ProgramHeader
Available on crate feature alloc only.
impl From<ProgramHeader> for ProgramHeader
Available on crate feature
alloc only.Source§fn from(ph: ElfProgramHeader) -> Self
fn from(ph: ElfProgramHeader) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ProgramHeader
impl PartialEq for ProgramHeader
Source§impl SizeWith<Ctx> for ProgramHeader
Available on crate feature alloc only.
impl SizeWith<Ctx> for ProgramHeader
Available on crate feature
alloc only.Source§impl<'a> TryFromCtx<'a, Ctx> for ProgramHeader
Available on crate feature alloc only.
impl<'a> TryFromCtx<'a, Ctx> for ProgramHeader
Available on crate feature
alloc only.Source§impl TryIntoCtx<Ctx> for ProgramHeader
Available on crate feature alloc only.
impl TryIntoCtx<Ctx> for ProgramHeader
Available on crate feature
alloc only.impl StructuralPartialEq for ProgramHeader
Auto Trait Implementations§
impl Freeze for ProgramHeader
impl RefUnwindSafe for ProgramHeader
impl Send for ProgramHeader
impl Sync for ProgramHeader
impl Unpin for ProgramHeader
impl UnwindSafe for ProgramHeader
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)