OpenSpanExt

Trait OpenSpanExt 

Source
pub trait OpenSpanExt {
    // Required methods
    fn get_context(&self) -> Context;
    fn get_current_context() -> Context;
    fn get_current_bytes() -> Vec<u8> ;
    fn set_context(&self, context: Context);
    fn set_current_context(context: Context);
    fn set_current_bytes(bytes: Vec<u8>);
    fn display_context(&self) -> String;

    // Provided methods
    fn get_context_bytes(&self) -> Vec<u8>  { ... }
    fn set_from_bytes(&self, bytes: Vec<u8>) { ... }
}
Expand description

Opentelemetry span extension trait. This trait provides helper methods to the tracing::Span for crossing thread and process boundaries.

Required Methods§

Source

fn get_context(&self) -> Context

Get the context of this span.

Source

fn get_current_context() -> Context

Get the context of the current span.

Source

fn get_current_bytes() -> Vec<u8>

Get the current span as message pack bytes.

Source

fn set_context(&self, context: Context)

Set the context of this span.

Source

fn set_current_context(context: Context)

Set the context of the current span.

Source

fn set_current_bytes(bytes: Vec<u8>)

Set the current span context from message pack bytes.

Source

fn display_context(&self) -> String

Display this spans context as a String.

Provided Methods§

Source

fn get_context_bytes(&self) -> Vec<u8>

Get the context as message pack bytes for sending over process boundaries.

Source

fn set_from_bytes(&self, bytes: Vec<u8>)

Set the context of this span from bytes over the network.

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 OpenSpanExt for Span

Implementors§