pub trait EnteredTraceSpan {
// Required method
fn or_if_tracing_disabled(self, f: impl FnOnce()) -> Self;
}Expand description
A marker trait returned by crate::interpret::Machine::enter_trace_span, identifying either a
real tracing::span::EnteredSpan in case tracing is enabled, or the dummy type () when
tracing is disabled. Also see crate::enter_trace_span! below.
Required Methods§
Sourcefn or_if_tracing_disabled(self, f: impl FnOnce()) -> Self
fn or_if_tracing_disabled(self, f: impl FnOnce()) -> Self
Allows executing an alternative function when tracing is disabled. Useful for example if you want to open a trace span when tracing is enabled, and alternatively just log a line when tracing is disabled.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".