pub struct Backtrace { /* private fields */ }Expand description
A captured stack backtrace with deferred symbol resolution.
Captured via Capturable. When backtrace capture is
disabled (see rust_backtrace) the capture is empty and records no
frames. Symbols are resolved lazily on first frame access and cached;
clones share one capture, so cloning is a refcount bump and resolution
happens once for all clones.
Implementations§
Source§impl Backtrace
impl Backtrace
Sourcepub const fn is_captured(&self) -> bool
pub const fn is_captured(&self) -> bool
true if frames were recorded at construction (capture was enabled and
the platform produced a stack). An empty backtrace renders nothing and
is not worth propagating over a fresh capture.
Never forces symbol resolution.
Number of trailing frames hidden by this trace’s marker: the suffix
shared with the marker stack, counted in rendered (symbol-level)
frames. None when no marker was set on the capturing thread, the
stacks share no frames (e.g. the marker came from another thread), the
cut would hide every frame, or none of the hidden frames carry symbols.
Forces symbol resolution, like frames.
Sourcepub fn resolve(&self)
pub fn resolve(&self)
Force symbol resolution now, caching the result in place.
Resolution is otherwise deferred until the first frame access
(as_backtrace / frames). Call
this to pay that cost at a controlled point — e.g. once up front rather
than during rendering.
Trait Implementations§
Source§impl Capturable for Backtrace
impl Capturable for Backtrace
Source§fn capture_or_extract(source: &dyn Diagnostic) -> Self
fn capture_or_extract(source: &dyn Diagnostic) -> Self
source, reusing equivalent data already on source
when that is more useful than a fresh capture. Read moreSource§impl From<&Backtrace> for ErasedBacktrace
Available on crate feature std only.
impl From<&Backtrace> for ErasedBacktrace
std only.