pub struct Symbols<'a> { /* private fields */ }
Expand description
A zero-copy “nlist” style symbol table (“stab”), including the string table
Implementations
sourceimpl<'a> Symbols<'a>
impl<'a> Symbols<'a>
sourcepub fn new(
bytes: &'a [u8],
start: usize,
count: usize,
strtab: usize
) -> Result<Symbols<'a>>
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
pub fn parse(
bytes: &'a [u8],
symtab: &SymtabCommand,
ctx: Ctx
) -> Result<Symbols<'a>>
pub fn iter(&self) -> SymbolIterator<'a>ⓘNotable traits for SymbolIterator<'a>impl<'a> Iterator for SymbolIterator<'a> type Item = Result<(&'a str, Nlist)>;
Trait Implementations
sourceimpl<'a, 'b> IntoIterator for &'b Symbols<'a>
impl<'a, 'b> IntoIterator for &'b Symbols<'a>
type Item = <SymbolIterator<'a> as Iterator>::Item
type Item = <SymbolIterator<'a> as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = SymbolIterator<'a>
type IntoIter = SymbolIterator<'a>
Which kind of iterator are we turning this into?
sourceimpl<'a, T: ?Sized> TryFromCtx<'a, SymbolsCtx, T> for Symbols<'a> where
T: AsRef<[u8]>,
impl<'a, T: ?Sized> TryFromCtx<'a, SymbolsCtx, T> for Symbols<'a> where
T: AsRef<[u8]>,
type Error = Error
fn try_from_ctx(bytes: &'a T, _: SymbolsCtx) -> Result<(Self, usize)>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more