Trait JoinSetTracer

Source
pub trait JoinSetTracer:
    Send
    + Sync
    + 'static {
    // Required methods
    fn trace_future(
        &self,
        fut: Pin<Box<dyn Future<Output = Box<dyn Any + Send>> + Send>>,
    ) -> Pin<Box<dyn Future<Output = Box<dyn Any + Send>> + Send>>;
    fn trace_block(
        &self,
        f: Box<dyn FnOnce() -> Box<dyn Any + Send> + Send>,
    ) -> Box<dyn FnOnce() -> Box<dyn Any + Send> + Send>;
}
Expand description

A trait for injecting instrumentation into either asynchronous futures or blocking closures at runtime.

Required Methods§

Source

fn trace_future( &self, fut: Pin<Box<dyn Future<Output = Box<dyn Any + Send>> + Send>>, ) -> Pin<Box<dyn Future<Output = Box<dyn Any + Send>> + Send>>

Function pointer type for tracing a future.

This function takes a boxed future (with its output type erased) and returns a boxed future (with its output still erased). The tracer must apply instrumentation without altering the output.

Source

fn trace_block( &self, f: Box<dyn FnOnce() -> Box<dyn Any + Send> + Send>, ) -> Box<dyn FnOnce() -> Box<dyn Any + Send> + Send>

Function pointer type for tracing a blocking closure.

This function takes a boxed closure (with its return type erased) and returns a boxed closure (with its return type still erased). The tracer must apply instrumentation without changing the return value.

Implementors§