Skip to main content

ObjectSafeTracer

Trait ObjectSafeTracer 

Source
pub trait ObjectSafeTracer {
    // Required method
    fn build_with_context_boxed(
        &self,
        builder: SpanBuilder,
        parent_cx: &Context,
    ) -> Box<dyn ObjectSafeSpan + Send + Sync>;
}
Expand description

Allows a specific Tracer to be used generically by BoxedTracer instances by mirroring the interface and boxing the return types.

Required Methods§

Source

fn build_with_context_boxed( &self, builder: SpanBuilder, parent_cx: &Context, ) -> Box<dyn ObjectSafeSpan + Send + Sync>

Returns a trait object so the underlying implementation can be swapped out at runtime.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<S, T> ObjectSafeTracer for T
where S: Span + Send + Sync + 'static, T: Tracer<Span = S>,