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

pub trait SectionHeader: Debug + Pod {
    type Word: Into<u64>;
    type Endian: Endian;
    type Elf: FileHeader<Word = Self::Word, Endian = Self::Endian>;
    fn sh_name(&self, endian: Self::Endian) -> u32;
fn sh_type(&self, endian: Self::Endian) -> u32;
fn sh_flags(&self, endian: Self::Endian) -> Self::Word;
fn sh_addr(&self, endian: Self::Endian) -> Self::Word;
fn sh_offset(&self, endian: Self::Endian) -> Self::Word;
fn sh_size(&self, endian: Self::Endian) -> Self::Word;
fn sh_link(&self, endian: Self::Endian) -> u32;
fn sh_info(&self, endian: Self::Endian) -> u32;
fn sh_addralign(&self, endian: Self::Endian) -> Self::Word;
fn sh_entsize(&self, endian: Self::Endian) -> Self::Word; fn file_range(&self, endian: Self::Endian) -> Option<(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 notes<'data>(
        &self,
        endian: Self::Endian,
        data: Bytes<'data>
    ) -> Result<Option<ElfNoteIterator<'data, Self::Elf>>> { ... } }

A trait for generic access to SectionHeader32 and SectionHeader64.

Associated Types

type Word: Into<u64>

type Endian: Endian

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

Loading content...

Required methods

fn sh_name(&self, endian: Self::Endian) -> u32

fn sh_type(&self, endian: Self::Endian) -> u32

fn sh_flags(&self, endian: Self::Endian) -> Self::Word

fn sh_addr(&self, endian: Self::Endian) -> Self::Word

fn sh_offset(&self, endian: Self::Endian) -> Self::Word

fn sh_size(&self, endian: Self::Endian) -> Self::Word

fn sh_info(&self, endian: Self::Endian) -> u32

fn sh_addralign(&self, endian: Self::Endian) -> Self::Word

fn sh_entsize(&self, endian: Self::Endian) -> Self::Word

Loading content...

Provided methods

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

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

Returns None for sections that have no data in the file.

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

Return the section data.

Returns Ok(&[]) if the section has no data. Returns Err for invalid values.

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

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

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

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

Return a note iterator for the section data.

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

Loading content...

Implementors

impl<Endian: Endian> SectionHeader for SectionHeader32<Endian>[src]

type Word = u32

type Endian = Endian

type Elf = FileHeader32<Endian>

impl<Endian: Endian> SectionHeader for SectionHeader64<Endian>[src]

type Word = u64

type Endian = Endian

type Elf = FileHeader64<Endian>

Loading content...