object::read::macho

Trait 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 Nlist32 and 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.

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> 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