trace_future

Function trace_future 

Source
pub fn trace_future<T, F>(future: F) -> BoxFuture<'static, T>
where F: Future<Output = T> + Send + 'static, T: Send + 'static,
Expand description

Optionally instruments a future with custom tracing.

If a tracer has been injected via set_tracer, the future’s output is boxed (erasing its type), passed to the tracer, and then downcast back to the expected type. If no tracer is set, the original future is returned.

§Type Parameters

  • T - The concrete output type of the future.
  • F - The future type.

§Parameters

  • future - The future to potentially instrument.