Skip to main content

Host

Trait Host 

Source
pub trait Host: Send {
    // Required methods
    fn on_start(
        &mut self,
        context: SpanContext,
    ) -> impl Future<Output = Result<()>> + Send;
    fn on_end(
        &mut self,
        span: SpanData,
    ) -> impl Future<Output = Result<()>> + Send;
    fn outer_span_context(
        &mut self,
    ) -> impl Future<Output = Result<SpanContext>> + Send;
}

Required Methods§

Source

fn on_start( &mut self, context: SpanContext, ) -> impl Future<Output = Result<()>> + Send

Called when a span is started.

Source

fn on_end(&mut self, span: SpanData) -> impl Future<Output = Result<()>> + Send

Called when a span is ended.

Source

fn outer_span_context( &mut self, ) -> impl Future<Output = Result<SpanContext>> + Send

Returns the span context of the host.

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.

Implementations on Foreign Types§

Source§

impl<_T: Host + ?Sized + Send> Host for &mut _T

Source§

fn on_start( &mut self, context: SpanContext, ) -> impl Future<Output = Result<()>> + Send

Called when a span is started.

Source§

fn on_end(&mut self, span: SpanData) -> impl Future<Output = Result<()>> + Send

Called when a span is ended.

Source§

fn outer_span_context( &mut self, ) -> impl Future<Output = Result<SpanContext>> + Send

Returns the span context of the host.

Implementors§