Trait netstack3_base::TracingContext
source · pub trait TracingContext {
type DurationScope;
// Required method
fn duration(&self, name: &'static CStr) -> Self::DurationScope;
}
Expand description
A context for emitting tracing data.
Required Associated Types§
sourcetype DurationScope
type DurationScope
The scope of a trace duration.
Its lifetime corresponds to the beginning and end of the duration.
Required Methods§
sourcefn duration(&self, name: &'static CStr) -> Self::DurationScope
fn duration(&self, name: &'static CStr) -> Self::DurationScope
Writes a duration event which ends when the returned scope is dropped.
Durations describe work which is happening synchronously on one thread.
Care should be taken to avoid a duration’s scope spanning an await
point in asynchronous code.