object::read::elf

Trait Sym

Source
pub trait Sym: Debug + Pod {
    type Word: Into<u64>;
    type Endian: Endian;

    // Required methods
    fn st_name(&self, endian: Self::Endian) -> u32;
    fn st_info(&self) -> u8;
    fn st_bind(&self) -> u8;
    fn st_type(&self) -> u8;
    fn st_other(&self) -> u8;
    fn st_visibility(&self) -> u8;
    fn st_shndx(&self, endian: Self::Endian) -> u16;
    fn st_value(&self, endian: Self::Endian) -> Self::Word;
    fn st_size(&self, endian: Self::Endian) -> Self::Word;

    // Provided methods
    fn name<'data, R: ReadRef<'data>>(
        &self,
        endian: Self::Endian,
        strings: StringTable<'data, R>,
    ) -> Result<&'data [u8]> { ... }
    fn is_undefined(&self, endian: Self::Endian) -> bool { ... }
    fn is_definition(&self, endian: Self::Endian) -> bool { ... }
}
Expand description

A trait for generic access to Sym32 and Sym64.

Required Associated Types§

Required Methods§

Source

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

Source

fn st_info(&self) -> u8

Source

fn st_bind(&self) -> u8

Source

fn st_type(&self) -> u8

Source

fn st_other(&self) -> u8

Source

fn st_visibility(&self) -> u8

Source

fn st_shndx(&self, endian: Self::Endian) -> u16

Source

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

Source

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

Provided Methods§

Source

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

Parse the symbol name from the string table.

Source

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

Return true if the symbol is undefined.

Source

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

Return true if the symbol is a definition of a function or data object.

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§

Source§

impl<Endian: Endian> Sym for Sym32<Endian>

Source§

type Word = u32

Source§

type Endian = Endian

Source§

impl<Endian: Endian> Sym for Sym64<Endian>

Source§

type Word = u64

Source§

type Endian = Endian