Struct object::read::coff::SymbolTable

source ·
pub struct SymbolTable<'data, R = &'data [u8]>where
    R: ReadRef<'data>,{ /* private fields */ }
Expand description

A table of symbol entries in a COFF or PE file.

Also includes the string table used for the symbol names.

Implementations§

source§

impl<'data, R: ReadRef<'data>> SymbolTable<'data, R>

source

pub fn parse(header: &ImageFileHeader, data: R) -> Result<Self>

Read the symbol table.

source

pub fn strings(&self) -> StringTable<'data, R>

Return the string table used for the symbol names.

source

pub fn is_empty(&self) -> bool

Return true if the symbol table is empty.

source

pub fn len(&self) -> usize

The number of symbol table entries.

This includes auxiliary symbol table entries.

source

pub fn iter<'table>(&'table self) -> SymbolIterator<'data, 'table, R>

Iterate over the symbols.

source

pub fn symbol(&self, index: usize) -> Result<&'data ImageSymbol>

Return the symbol table entry at the given index.

source

pub fn aux_function( &self, index: usize ) -> Result<&'data ImageAuxSymbolFunction>

Return the auxiliary function symbol for the symbol table entry at the given index.

Note that the index is of the symbol, not the first auxiliary record.

source

pub fn aux_section(&self, index: usize) -> Result<&'data ImageAuxSymbolSection>

Return the auxiliary section symbol for the symbol table entry at the given index.

Note that the index is of the symbol, not the first auxiliary record.

source

pub fn aux_file_name(&self, index: usize, aux_count: u8) -> Result<&'data [u8]>

Return the auxiliary file name for the symbol table entry at the given index.

Note that the index is of the symbol, not the first auxiliary record.

source

pub fn get<T: Pod>(&self, index: usize, offset: usize) -> Result<&'data T>

Return the symbol table entry or auxiliary record at the given index and offset.

source

pub fn map<Entry: SymbolMapEntry, F: Fn(&'data ImageSymbol) -> Option<Entry>>( &self, f: F ) -> SymbolMap<Entry>

Construct a map from addresses to a user-defined map entry.

Trait Implementations§

source§

impl<'data, R> Debug for SymbolTable<'data, R>where R: ReadRef<'data> + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'data, R: ReadRef<'data>> Default for SymbolTable<'data, R>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'data, R> RefUnwindSafe for SymbolTable<'data, R>where R: RefUnwindSafe,

§

impl<'data, R> Send for SymbolTable<'data, R>where R: Send,

§

impl<'data, R> Sync for SymbolTable<'data, R>where R: Sync,

§

impl<'data, R> Unpin for SymbolTable<'data, R>where R: Unpin,

§

impl<'data, R> UnwindSafe for SymbolTable<'data, R>where R: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.