Trait object::read::elf::ProgramHeader[][src]

pub trait ProgramHeader: Debug + Pod {
    type Elf: FileHeader<ProgramHeader = Self, Endian = Self::Endian, Word = Self::Word>;
    type Word: Into<u64>;
    type Endian: Endian;
    fn p_type(&self, endian: Self::Endian) -> u32;
fn p_flags(&self, endian: Self::Endian) -> u32;
fn p_offset(&self, endian: Self::Endian) -> Self::Word;
fn p_vaddr(&self, endian: Self::Endian) -> Self::Word;
fn p_paddr(&self, endian: Self::Endian) -> Self::Word;
fn p_filesz(&self, endian: Self::Endian) -> Self::Word;
fn p_memsz(&self, endian: Self::Endian) -> Self::Word;
fn p_align(&self, endian: Self::Endian) -> Self::Word; fn file_range(&self, endian: Self::Endian) -> (u64, u64) { ... }
fn data<'data>(
        &self,
        endian: Self::Endian,
        data: Bytes<'data>
    ) -> Result<Bytes<'data>, ()> { ... }
fn data_as_array<'data, T: Pod>(
        &self,
        endian: Self::Endian,
        data: Bytes<'data>
    ) -> Result<&'data [T], ()> { ... }
fn data_range<'data>(
        &self,
        endian: Self::Endian,
        data: Bytes<'data>,
        address: u64,
        size: u64
    ) -> Result<Option<Bytes<'data>>, ()> { ... }
fn dynamic<'data>(
        &self,
        endian: Self::Endian,
        data: Bytes<'data>
    ) -> Result<Option<&'data [<Self::Elf as FileHeader>::Dyn]>> { ... }
fn notes<'data>(
        &self,
        endian: Self::Endian,
        data: Bytes<'data>
    ) -> Result<Option<NoteIterator<'data, Self::Elf>>> { ... } }

A trait for generic access to ProgramHeader32 and ProgramHeader64.

Associated Types

type Elf: FileHeader<ProgramHeader = Self, Endian = Self::Endian, Word = Self::Word>[src]

type Word: Into<u64>[src]

type Endian: Endian[src]

Loading content...

Required methods

fn p_type(&self, endian: Self::Endian) -> u32[src]

fn p_flags(&self, endian: Self::Endian) -> u32[src]

fn p_offset(&self, endian: Self::Endian) -> Self::Word[src]

fn p_vaddr(&self, endian: Self::Endian) -> Self::Word[src]

fn p_paddr(&self, endian: Self::Endian) -> Self::Word[src]

fn p_filesz(&self, endian: Self::Endian) -> Self::Word[src]

fn p_memsz(&self, endian: Self::Endian) -> Self::Word[src]

fn p_align(&self, endian: Self::Endian) -> Self::Word[src]

Loading content...

Provided methods

fn file_range(&self, endian: Self::Endian) -> (u64, u64)[src]

Return the offset and size of the segment in the file.

fn data<'data>(
    &self,
    endian: Self::Endian,
    data: Bytes<'data>
) -> Result<Bytes<'data>, ()>
[src]

Return the segment data.

Returns Err for invalid values.

fn data_as_array<'data, T: Pod>(
    &self,
    endian: Self::Endian,
    data: Bytes<'data>
) -> Result<&'data [T], ()>
[src]

Return the segment data as a slice of the given type.

Allows padding at the end of the data. Returns Ok(&[]) if the segment has no data. Returns Err for invalid values, including bad alignment.

fn data_range<'data>(
    &self,
    endian: Self::Endian,
    data: Bytes<'data>,
    address: u64,
    size: u64
) -> Result<Option<Bytes<'data>>, ()>
[src]

Return the segment data in the given virtual address range

Returns Ok(None) if the segment does not contain the address. Returns Err for invalid values.

fn dynamic<'data>(
    &self,
    endian: Self::Endian,
    data: Bytes<'data>
) -> Result<Option<&'data [<Self::Elf as FileHeader>::Dyn]>>
[src]

Return entries in a dynamic segment.

Returns Ok(None) if the segment is not PT_DYNAMIC. Returns Err for invalid values.

fn notes<'data>(
    &self,
    endian: Self::Endian,
    data: Bytes<'data>
) -> Result<Option<NoteIterator<'data, Self::Elf>>>
[src]

Return a note iterator for the segment data.

Returns Ok(None) if the segment does not contain notes. Returns Err for invalid values.

Loading content...

Implementors

impl<Endian: Endian> ProgramHeader for ProgramHeader32<Endian>[src]

type Word = u32

type Endian = Endian

type Elf = FileHeader32<Endian>

impl<Endian: Endian> ProgramHeader for ProgramHeader64<Endian>[src]

type Word = u64

type Endian = Endian

type Elf = FileHeader64<Endian>

Loading content...