pub struct Trace { /* private fields */ }
Expand description
An execution trace.
This trace is constructed by calling Trace::root
with a closure, and
includes all execution Trace of that closure that end in an invocation of
Trace::leaf
.
Implementations§
Source§impl Trace
impl Trace
Sourcepub fn root<F, R>(f: F) -> (R, Trace)where
F: FnOnce() -> R,
pub fn root<F, R>(f: F) -> (R, Trace)where
F: FnOnce() -> R,
Invokes f
, returning both its result and the collection of backtraces
captured at each sub-invocation of Trace::leaf
.
Sourcepub fn leaf()
pub fn leaf()
If this is a sub-invocation of Trace::root
, capture a backtrace.
The captured backtrace will be returned by Trace::root
.
Invoking this function does nothing when it is not a sub-invocation
Trace::root
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Trace
impl RefUnwindSafe for Trace
impl Send for Trace
impl Sync for Trace
impl Unpin for Trace
impl UnwindSafe for Trace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more