pub struct Sym<'a> {
pub kind: SymKind,
pub data: &'a [u8],
}Expand description
Points to one symbol record in memory and gives its kind.
Fields§
§kind: SymKindThe kind of the symbol.
data: &'a [u8]The contents of the record. This slice does not include the len or kind fields.
Implementations§
Source§impl<'a> Sym<'a>
impl<'a> Sym<'a>
Sourcepub fn parse(&self) -> Result<SymData<'a>, ParserError>
pub fn parse(&self) -> Result<SymData<'a>, ParserError>
Parse the payload of the symbol.
Sourcepub fn parse_as<T>(&self) -> Result<T, ParserError>where
T: Parse<'a>,
pub fn parse_as<T>(&self) -> Result<T, ParserError>where
T: Parse<'a>,
Parses the payload of the symbol with a type chosen by the caller.
This is useful when the caller has already tested Sym::kind and knows the type of the
payload.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Sym<'a>
impl<'a> RefUnwindSafe for Sym<'a>
impl<'a> Send for Sym<'a>
impl<'a> Sync for Sym<'a>
impl<'a> Unpin for Sym<'a>
impl<'a> UnwindSafe for Sym<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more