object::read::xcoff

Trait SectionHeader

Source
pub trait SectionHeader: Debug + Pod {
    type Word: Into<u64>;
    type HalfWord: Into<u32>;
    type Xcoff: FileHeader<SectionHeader = Self, Word = Self::Word>;
    type Rel: Rel<Word = Self::Word>;

Show 14 methods // Required methods fn s_name(&self) -> &[u8; 8]; fn s_paddr(&self) -> Self::Word; fn s_vaddr(&self) -> Self::Word; fn s_size(&self) -> Self::Word; fn s_scnptr(&self) -> Self::Word; fn s_relptr(&self) -> Self::Word; fn s_lnnoptr(&self) -> Self::Word; fn s_nreloc(&self) -> Self::HalfWord; fn s_nlnno(&self) -> Self::HalfWord; fn s_flags(&self) -> u32; fn relocations<'data, R: ReadRef<'data>>( &self, data: R, ) -> Result<&'data [Self::Rel]>; // Provided methods fn name(&self) -> &[u8] { ... } fn file_range(&self) -> Option<(u64, u64)> { ... } fn data<'data, R: ReadRef<'data>>(&self, data: R) -> Result<&'data [u8], ()> { ... }
}
Expand description

A trait for generic access to xcoff::SectionHeader32 and xcoff::SectionHeader64.

Required Associated Types§

Source

type Word: Into<u64>

Source

type HalfWord: Into<u32>

Source

type Xcoff: FileHeader<SectionHeader = Self, Word = Self::Word>

Source

type Rel: Rel<Word = Self::Word>

Required Methods§

Source

fn s_name(&self) -> &[u8; 8]

Source

fn s_paddr(&self) -> Self::Word

Source

fn s_vaddr(&self) -> Self::Word

Source

fn s_size(&self) -> Self::Word

Source

fn s_scnptr(&self) -> Self::Word

Source

fn s_relptr(&self) -> Self::Word

Source

fn s_lnnoptr(&self) -> Self::Word

Source

fn s_nreloc(&self) -> Self::HalfWord

Source

fn s_nlnno(&self) -> Self::HalfWord

Source

fn s_flags(&self) -> u32

Source

fn relocations<'data, R: ReadRef<'data>>( &self, data: R, ) -> Result<&'data [Self::Rel]>

Read the relocations.

Provided Methods§

Source

fn name(&self) -> &[u8]

Return the section name.

Source

fn file_range(&self) -> Option<(u64, u64)>

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

Source

fn data<'data, R: ReadRef<'data>>(&self, data: R) -> Result<&'data [u8], ()>

Return the section data.

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§