Struct mini_backtrace::Backtrace[][src]

pub struct Backtrace<const N: usize> {
    pub frames: ArrayVec<usize, N>,
    pub frames_omitted: bool,
}
Expand description

A backtrace consisting of a list of instruction pointer addresses.

The backtrace does not allocate any memory, which allows it to be used in environments where dynamic allocation cannot be used such as signal handlers or interrupt handlers.

The N generic constant controls the maximum number of entries that should be included in the backtrace. Usually 16 frames are enough to get sufficient context from a crash.

Fields

frames: ArrayVec<usize, N>
Expand description

List of instruction pointer addresses in each frame, from most recent to oldest.

These are not precise return address: the addresses are adjusted so that they point within the bounds of the caller function. This avoids issues when a call instruction is the last instruction in a function, which would otherwise result in a return address pointing at the start of the next function.

frames_omitted: bool
Expand description

Whether any frames have been omitted due to exceeding the capacity of the ArrayVec.

Implementations

impl<const N: usize> Backtrace<N>[src]

pub fn capture() -> Self[src]

Captures a backtrace from the current call point.

The first frame of the backtrace is the caller of Backtrace::capture.

Trait Implementations

impl<const N: usize> Clone for Backtrace<N>[src]

fn clone(&self) -> Backtrace<N>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<const N: usize> Debug for Backtrace<N>[src]

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

Formats the value using the given formatter. Read more

impl<const N: usize> Default for Backtrace<N>[src]

fn default() -> Backtrace<N>[src]

Returns the “default value” for a type. Read more

Auto Trait Implementations

impl<const N: usize> Send for Backtrace<N>

impl<const N: usize> Sync for Backtrace<N>

impl<const N: usize> Unpin for Backtrace<N>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.