Trait object::read::macho::symbol::Nlist

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

    // Required methods
    fn n_strx(&self, endian: Self::Endian) -> u32;
    fn n_type(&self) -> u8;
    fn n_sect(&self) -> u8;
    fn n_desc(&self, endian: Self::Endian) -> u16;
    fn n_value(&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_stab(&self) -> bool { ... }
    fn is_undefined(&self) -> bool { ... }
    fn is_definition(&self) -> bool { ... }
    fn library_ordinal(&self, endian: Self::Endian) -> u8 { ... }
}
Expand description

A trait for generic access to macho::Nlist32 and macho::Nlist64.

Required Associated Types§

Required Methods§

source

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

source

fn n_type(&self) -> u8

source

fn n_sect(&self) -> u8

source

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

source

fn n_value(&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]>

source

fn is_stab(&self) -> bool

Return true if this is a STAB symbol.

This determines the meaning of the n_type field.

source

fn is_undefined(&self) -> bool

Return true if this is an undefined symbol.

source

fn is_definition(&self) -> bool

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

source

fn library_ordinal(&self, endian: Self::Endian) -> u8

Return the library ordinal.

This is either a 1-based index into the dylib load commands, or a special ordinal.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Endian: Endian> Nlist for Nlist32<Endian>

source§

type Word = u32

source§

type Endian = Endian

source§

impl<Endian: Endian> Nlist for Nlist64<Endian>

source§

type Word = u64

source§

type Endian = Endian