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

pub trait ProgramHeader: Debug + Pod {
    type Word: Into<u64>;
    type Endian: Endian;
    type Elf: FileHeader<Word = Self::Word, Endian = Self::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 notes<'data>(
        &self,
        endian: Self::Endian,
        data: Bytes<'data>
    ) -> Result<Option<ElfNoteIterator<'data, Self::Elf>>> { ... } }

A trait for generic access to ProgramHeader32 and ProgramHeader64.

Associated Types

type Word: Into<u64>

type Endian: Endian

type Elf: FileHeader<Word = Self::Word, Endian = Self::Endian>

Loading content...

Required methods

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

Loading content...

Provided methods

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

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

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

Return the segment data.

Returns Err for invalid values.

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

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...