pub struct Backtrace { /* fields omitted */ }
Representation of an owned and self-contained backtrace.
This structure can be used to capture a backtrace at various points in a
program and later used to inspect what the backtrace was at that time.
Captures a backtrace at the callsite of this function, returning an
owned representation.
This function is useful for representing a backtrace as an object in
Rust. This returned value can be sent across threads and printed
elsewhere, and the purpose of this value is to be entirely self
contained.
use backtrace::Backtrace;
let current_backtrace = Backtrace::new();
Similar to new
except that this does not resolve any symbols, this
simply captures the backtrace as a list of addresses.
At a later time the resolve
function can be called to resolve this
backtrace's symbols into readable names. This function exists because
the resolution process can sometimes take a significant amount of time
whereas any one backtrace may only be rarely printed.
use backtrace::Backtrace;
let mut current_backtrace = Backtrace::new_unresolved();
println!("{:?}", current_backtrace);
current_backtrace.resolve();
println!("{:?}", current_backtrace);
Returns the frames from when this backtrace was captured.
The first entry of this slice is likely the function Backtrace::new
,
and the last frame is likely something about how this thread or the main
function started.
If this backtrace was created from new_unresolved
then this function
will resolve all addresses in the backtrace to their symbolic names.
If this backtrace has been previously resolved or was created through
new
, this function does nothing.
Returns the "default value" for a type. Read more
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)