[−][src]Trait opentelemetry::api::trace::tracer::TracerGenerics
TracerGenerics are functions that have generic type parameters. They are a separate
trait so that Tracer
can be used as a trait object in GlobalTracer
.
Required methods
fn with_span<T, F>(&self, name: &'static str, f: F) -> T where
F: FnOnce() -> T,
F: FnOnce() -> T,
Wraps the execution of the function body with a span. It starts a new span and sets it as the active span for the given function. It then executes the body. It closes the span before returning the execution result.
Implementors
impl<S: Tracer> TracerGenerics for S
[src]
fn with_span<T, F>(&self, name: &'static str, f: F) -> T where
F: FnOnce() -> T,
[src]
F: FnOnce() -> T,
Wraps the execution of the function body with a span. It starts a new span and sets it as the active span for the given function. It then executes the body. It closes the span before returning the execution result.