Struct SymbolName

pub struct SymbolName<'a> { pub(in ::backtrace_rs::symbolize) bytes: &'a [u8], pub(in ::backtrace_rs::symbolize) demangled: Option<Demangle<'a>> }

A wrapper around a symbol name to provide ergonomic accessors to the demangled name, the raw bytes, the raw string, etc.

Fields

bytes: &'a [u8]
demangled: Option<Demangle<'a>>

Implementations

impl<'a> SymbolName<'a>

fn new(bytes: &'a [u8]) -> SymbolName<'a>

Creates a new symbol name from the raw underlying bytes.

fn as_str(&self) -> Option<&'a str>

Returns the raw (mangled) symbol name as a str if the symbol is valid utf-8.

Use the Display implementation if you want the demangled version.

fn as_bytes(&self) -> &'a [u8]

Returns the raw symbol name as a list of bytes

Trait Implementations

impl<'a> Debug for SymbolName<'a>

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

impl<'a> Display for SymbolName<'a>

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

Auto Trait Implementations

impl<'a> Freeze for SymbolName<'a>

impl<'a> RefUnwindSafe for SymbolName<'a>

impl<'a> Send for SymbolName<'a>

impl<'a> Sync for SymbolName<'a>

impl<'a> Unpin for SymbolName<'a>

impl<'a> UnsafeUnpin for SymbolName<'a>

impl<'a> UnwindSafe for SymbolName<'a>

Blanket Implementations

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

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for SymbolName<'a> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for SymbolName<'a> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for SymbolName<'a>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> SizeHint for SymbolName<'a> where T: ?Sized,

fn lower_bound(&self) -> usize
fn upper_bound(&self) -> Option<usize>

impl<T> SizedTypeProperties for SymbolName<'a>

impl<T> ToString for SymbolName<'a> where T: Display + ?Sized,

fn to_string(&self) -> String

impl<T, U> Into<U> for SymbolName<'a> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for SymbolName<'a> where U: Into<T>,

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto<U> for SymbolName<'a> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>