Struct std::backtrace_rs::symbolize::Symbol
source · pub struct Symbol {
inner: Symbol<'static>,
}
Expand description
A trait representing the resolution of a symbol in a file.
This trait is yielded as a trait object to the closure given to the
backtrace::resolve
function, and it is virtually dispatched as it’s
unknown which implementation is behind it.
A symbol can give contextual information about a function, for example the
name, filename, line number, precise address, etc. Not all information is
always available in a symbol, however, so all methods return an Option
.
Fields§
§inner: Symbol<'static>
Implementations§
source§impl Symbol
impl Symbol
sourcepub fn name(&self) -> Option<SymbolName<'_>>
pub fn name(&self) -> Option<SymbolName<'_>>
Returns the name of this function.
The returned structure can be used to query various properties about the symbol name:
- The
Display
implementation will print out the demangled symbol. - The raw
str
value of the symbol can be accessed (if it’s valid utf-8). - The raw bytes for the symbol name can be accessed.
sourcepub fn filename_raw(&self) -> Option<BytesOrWideString<'_>>
pub fn filename_raw(&self) -> Option<BytesOrWideString<'_>>
Returns the raw filename as a slice. This is mainly useful for no_std
environments.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Symbol
impl Send for Symbol
impl Sync for Symbol
impl Unpin for Symbol
impl UnwindSafe for Symbol
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