Skip to main content

JoinSetTracer

Trait JoinSetTracer 

Source
pub trait JoinSetTracer:
    Send
    + Sync
    + 'static {
    // Required methods
    fn trace_future(
        &self,
        fut: BoxFuture<'static, Box<dyn Any + Send>>,
    ) -> BoxFuture<'static, Box<dyn Any + 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: BoxFuture<'static, Box<dyn Any + Send>>, ) -> BoxFuture<'static, Box<dyn Any + 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.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§