pub struct SpanTrace { /* private fields */ }Expand description
A wrapper around tracing_error::SpanTrace.
Implementations§
Source§impl SpanTrace
impl SpanTrace
Sourcepub fn capture() -> Self
pub fn capture() -> Self
Captures the currently active span stack from the installed subscriber.
Yields an empty trace when no span is active or the subscriber does not
support span traces; check is_captured to tell the
two apart.
Sourcepub fn status(&self) -> SpanTraceStatus
pub fn status(&self) -> SpanTraceStatus
Returns whether this trace was captured, empty, or unsupported.
Sourcepub fn is_captured(&self) -> bool
pub fn is_captured(&self) -> bool
true if a span trace was actually captured (an active span existed and
the subscriber supports SpanTrace). An empty/unsupported trace yields
no frames and should not be rendered as a SPANTRACE section.
Sourcepub fn into_span_trace(self) -> SpanTrace
pub fn into_span_trace(self) -> SpanTrace
Consumes the wrapper and returns the underlying tracing_error::SpanTrace.
Sourcepub const fn as_span_trace(&self) -> &SpanTrace
pub const fn as_span_trace(&self) -> &SpanTrace
Borrows the underlying tracing_error::SpanTrace.
Trait Implementations§
Source§impl Capturable for SpanTrace
impl Capturable for SpanTrace
Source§fn capture_or_extract(source: &dyn Diagnostic) -> Self
fn capture_or_extract(source: &dyn Diagnostic) -> Self
Capture for an error that wraps
source, reusing equivalent data already on source
when that is more useful than a fresh capture. Read moreSource§impl From<&SpanTrace> for ErasedSpanTrace
Available on crate feature tracing only.
impl From<&SpanTrace> for ErasedSpanTrace
Available on crate feature
tracing only.Source§impl From<SpanTrace> for OptionalSpanTrace
impl From<SpanTrace> for OptionalSpanTrace
Auto Trait Implementations§
impl !RefUnwindSafe for SpanTrace
impl !UnwindSafe for SpanTrace
impl Freeze for SpanTrace
impl Send for SpanTrace
impl Sync for SpanTrace
impl Unpin for SpanTrace
impl UnsafeUnpin for SpanTrace
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