#[repr(C)]pub struct Phdr32 {
pub p_type: Elf32Word,
pub p_offset: Elf32Off,
pub p_vaddr: Elf32Addr,
pub p_paddr: Elf32Addr,
pub p_filesz: Elf32Word,
pub p_memsz: Elf32Word,
pub p_flags: Elf32Word,
pub p_align: Elf32Word,
}
Fields§
§p_type: Elf32Word
Segment type
p_offset: Elf32Off
Segment file offset
p_vaddr: Elf32Addr
Segment virtual address
p_paddr: Elf32Addr
Segment physical address
p_filesz: Elf32Word
Segment size in file
p_memsz: Elf32Word
Segment size in memory
p_flags: Elf32Word
Segment flags
p_align: Elf32Word
Segment alignment
Implementations§
Source§impl Phdr32
impl Phdr32
pub const SIZE: usize = 32usize
pub fn get_type(&self) -> Type
pub fn set_flags<'a, I>(&mut self, flags: I)
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::Phdr32 = 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::Phdr32;
let null_phdr : Phdr32 = Default::default();
assert_eq!([0].repeat(Phdr32::SIZE), null_phdr.to_le_bytes());
pub fn deserialize(buf: &[u8], start: usize) -> Result<Self, Box<dyn Error>>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Phdr32
impl<'de> Deserialize<'de> for Phdr32
Source§fn 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
Source§impl Ord for Phdr32
impl Ord for Phdr32
Source§impl PartialOrd for Phdr32
impl PartialOrd for Phdr32
impl Copy for Phdr32
impl Eq for Phdr32
impl StructuralPartialEq for Phdr32
Auto Trait Implementations§
impl Freeze for Phdr32
impl RefUnwindSafe for Phdr32
impl Send for Phdr32
impl Sync for Phdr32
impl Unpin for Phdr32
impl UnwindSafe for Phdr32
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