Struct object::read::xcoff::symbol::SymbolTable

source ·
pub struct SymbolTable<'data, Xcoff, R = &'data [u8]>
where Xcoff: FileHeader, R: ReadRef<'data>,
{ symbols: &'data [SymbolBytes], strings: StringTable<'data, R>, header: PhantomData<Xcoff>, }
Expand description

A table of symbol entries in an XCOFF file.

Also includes the string table used for the symbol names.

Returned by FileHeader::symbols.

Fields§

§symbols: &'data [SymbolBytes]§strings: StringTable<'data, R>§header: PhantomData<Xcoff>

Implementations§

source§

impl<'data, Xcoff, R> SymbolTable<'data, Xcoff, R>
where Xcoff: FileHeader, R: ReadRef<'data>,

source

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

Parse the symbol table.

source

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

Return the string table used for the symbol names.

source

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

Iterate over the symbols.

This does not return null symbols.

source

pub(super) fn iter_none<'table>( &'table self, ) -> SymbolIterator<'data, 'table, Xcoff, R>

Empty symbol iterator.

source

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

Return the symbol entry at the given index and offset.

source

fn symbol_unchecked(&self, index: SymbolIndex) -> Result<&'data Xcoff::Symbol>

Get the symbol at the given index.

This does not check if the symbol is null, but does check if the index is in bounds.

source

pub fn symbol(&self, index: SymbolIndex) -> Result<&'data Xcoff::Symbol>

Get the symbol at the given index.

Returns an error for null symbols and out of bounds indices. Note that this is unable to check whether the index is an auxiliary symbol.

source

pub fn aux_file( &self, index: SymbolIndex, offset: usize, ) -> Result<&'data Xcoff::FileAux>

Return a file auxiliary symbol.

source

pub fn aux_csect( &self, index: SymbolIndex, offset: usize, ) -> Result<&'data Xcoff::CsectAux>

Return the csect auxiliary symbol.

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.

Trait Implementations§

source§

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

source§

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

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

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

source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<'data, Xcoff, R> Freeze for SymbolTable<'data, Xcoff, R>
where R: Freeze,

§

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

§

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

§

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

§

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

§

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

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

source§

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 T
where U: TryFrom<T>,

source§

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.