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>

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

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

Implementations

Captures a backtrace from the current call point.

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

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.