Skip to main content

Instrument

Trait Instrument 

Source
pub trait Instrument: Sized + Future {
    // Provided method
    fn instrument(self, scope: ScopeFrame) -> Instrumented<Self>  { ... }
}
Expand description

Public extension trait — .instrument(scope!(...)) on every future owned by user code.

Provided Methods§

Source

fn instrument(self, scope: ScopeFrame) -> Instrumented<Self>

Attach an obs::scope!-built frame to the future. The frame is re-entered on every poll, so suspended futures keep their scope across .await and tokio::spawn boundaries.

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> Instrument for F
where F: Future,