Trait object::read::elf::Dyn

source ·
pub trait Dyn: Debug + Pod {
    type Word: Into<u64>;
    type Endian: Endian;

    // Required methods
    fn d_tag(&self, endian: Self::Endian) -> Self::Word;
    fn d_val(&self, endian: Self::Endian) -> Self::Word;

    // Provided methods
    fn tag32(&self, endian: Self::Endian) -> Option<u32> { ... }
    fn val32(&self, endian: Self::Endian) -> Option<u32> { ... }
    fn is_string(&self, endian: Self::Endian) -> bool { ... }
    fn string<'data>(
        &self,
        endian: Self::Endian,
        strings: StringTable<'data>,
    ) -> Result<&'data [u8]> { ... }
    fn is_address(&self, endian: Self::Endian) -> bool { ... }
}
Expand description

A trait for generic access to elf::Dyn32 and elf::Dyn64.

Required Associated Types§

Required Methods§

source

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

source

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

Provided Methods§

source

fn tag32(&self, endian: Self::Endian) -> Option<u32>

Try to convert the tag to a u32.

source

fn val32(&self, endian: Self::Endian) -> Option<u32>

Try to convert the value to a u32.

source

fn is_string(&self, endian: Self::Endian) -> bool

Return true if the value is an offset in the dynamic string table.

source

fn string<'data>( &self, endian: Self::Endian, strings: StringTable<'data>, ) -> Result<&'data [u8]>

Use the value to get a string in a string table.

Does not check for an appropriate tag.

source

fn is_address(&self, endian: Self::Endian) -> bool

Return true if the value is an address.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Endian: Endian> Dyn for Dyn32<Endian>

source§

type Word = u32

source§

type Endian = Endian

source§

impl<Endian: Endian> Dyn for Dyn64<Endian>

source§

type Word = u64

source§

type Endian = Endian