Struct goblin::mach::symbols::Symbols

source ·
pub struct Symbols<'a> { /* private fields */ }
Expand description

A zero-copy “nlist” style symbol table (“stab”), including the string table

Implementations§

source§

impl<'a> Symbols<'a>

source

pub fn new( bytes: &'a [u8], start: usize, count: usize, strtab: usize ) -> Result<Symbols<'a>>

Creates a new symbol table with count elements, from the start offset, using the string table at strtab, with a default ctx. Beware, this will provide incorrect results if you construct this on a 32-bit mach binary, using a 64-bit machine; use parse instead if you want 32/64 bit support

source

pub fn parse( bytes: &'a [u8], symtab: &SymtabCommand, ctx: Ctx ) -> Result<Symbols<'a>>

source

pub fn iter(&self) -> SymbolIterator<'a>

source

pub fn get(&self, index: usize) -> Result<(&'a str, Nlist)>

Parses a single Nlist symbol from the binary, with its accompanying name

Trait Implementations§

source§

impl<'a> Debug for Symbols<'a>

source§

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

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

impl<'a, 'b> IntoIterator for &'b Symbols<'a>

§

type Item = <SymbolIterator<'a> as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = SymbolIterator<'a>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<'a, T> TryFromCtx<'a, SymbolsCtx, T> for Symbols<'a>
where T: AsRef<[u8]> + ?Sized,

§

type Error = Error

source§

fn try_from_ctx(bytes: &'a T, _: SymbolsCtx) -> Result<(Self, usize)>

Auto Trait Implementations§

§

impl<'a> Freeze for Symbols<'a>

§

impl<'a> RefUnwindSafe for Symbols<'a>

§

impl<'a> Send for Symbols<'a>

§

impl<'a> Sync for Symbols<'a>

§

impl<'a> Unpin for Symbols<'a>

§

impl<'a> UnwindSafe for Symbols<'a>

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

§

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

§

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.