MaybeInstrument

Trait MaybeInstrument 

Source
pub trait MaybeInstrument: Future + Sized {
    // Provided method
    fn maybe_instrument(self, _name: &'static str) -> Self { ... }
}
Expand description

Conditionally instruments futures with tracing spans.

This trait provides a unified interface for adding tracing instrumentation to async operations. When the “tracing” feature is enabled, futures are wrapped with debug-level spans. When disabled, futures are returned unchanged.

Provided Methods§

Source

fn maybe_instrument(self, _name: &'static str) -> Self

No-op implementation when tracing is disabled.

§Arguments
  • _name - Ignored static name parameter.
§Returns

The original future unchanged.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<F: Future> MaybeInstrument for F

Blanket implementation for all Future types.