Struct elf_utilities::segment::Phdr64
source · [−]#[repr(C)]pub struct Phdr64 {
pub p_type: Elf64Word,
pub p_flags: Elf64Word,
pub p_offset: Elf64Off,
pub p_vaddr: Elf64Addr,
pub p_paddr: Elf64Addr,
pub p_filesz: Elf64Xword,
pub p_memsz: Elf64Xword,
pub p_align: Elf64Xword,
}Fields
p_type: Elf64WordSegment type
p_flags: Elf64WordSegment flags
p_offset: Elf64OffSegment file offset
p_vaddr: Elf64AddrSegment virtual address
p_paddr: Elf64AddrSegment physical address
p_filesz: Elf64XwordSegment size in file
p_memsz: Elf64XwordSegment size in memory
p_align: Elf64XwordSegment alignment
Implementations
sourceimpl Phdr64
impl Phdr64
pub fn size() -> Elf64Half
pub fn get_type(&self) -> TYPE
sourcepub fn set_type(&mut self, ptype: TYPE)
pub fn set_type(&mut self, ptype: TYPE)
Examples
use elf_utilities::segment;
let mut phdr : segment::Phdr64 = Default::default();
phdr.set_type(segment::TYPE::LOAD);
assert_eq!(phdr.get_type(), segment::TYPE::LOAD);sourcepub fn to_le_bytes(&self) -> Vec<u8>
pub fn to_le_bytes(&self) -> Vec<u8>
Create Vec
Examples
use elf_utilities::segment::Phdr64;
let null_phdr : Phdr64 = Default::default();
assert_eq!([0].repeat(Phdr64::size() as usize), null_phdr.to_le_bytes());pub fn deserialize(buf: &[u8], start: usize) -> Result<Self, Box<dyn Error>>
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Phdr64
impl<'de> Deserialize<'de> for Phdr64
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Ord for Phdr64
impl Ord for Phdr64
sourceimpl PartialOrd<Phdr64> for Phdr64
impl PartialOrd<Phdr64> for Phdr64
sourcefn partial_cmp(&self, other: &Phdr64) -> Option<Ordering>
fn partial_cmp(&self, other: &Phdr64) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Copy for Phdr64
impl Eq for Phdr64
impl StructuralEq for Phdr64
impl StructuralPartialEq for Phdr64
Auto Trait Implementations
impl RefUnwindSafe for Phdr64
impl Send for Phdr64
impl Sync for Phdr64
impl Unpin for Phdr64
impl UnwindSafe for Phdr64
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