rama::telemetry::opentelemetry::propagation

Trait TextMapPropagator

pub trait TextMapPropagator: Debug {
    // Required methods
    fn inject_context(&self, cx: &Context, injector: &mut dyn Injector);
    fn extract_with_context(
        &self,
        cx: &Context,
        extractor: &dyn Extractor,
    ) -> Context;
    fn fields(&self) -> FieldIter<'_> ;

    // Provided methods
    fn inject(&self, injector: &mut dyn Injector) { ... }
    fn extract(&self, extractor: &dyn Extractor) -> Context { ... }
}
Expand description

Methods to inject and extract a value as text into injectors and extractors that travel in-band across process boundaries.

Required Methods§

fn inject_context(&self, cx: &Context, injector: &mut dyn Injector)

Properly encodes the values of the Context and injects them into the Injector.

fn extract_with_context( &self, cx: &Context, extractor: &dyn Extractor, ) -> Context

Retrieves encoded data using the provided Extractor. If no data for this format was retrieved OR if the retrieved data is invalid, then the given Context is returned.

fn fields(&self) -> FieldIter<'_>

Returns iter of fields used by TextMapPropagator

Provided Methods§

fn inject(&self, injector: &mut dyn Injector)

Properly encodes the values of the current Context and injects them into the Injector.

fn extract(&self, extractor: &dyn Extractor) -> Context

Retrieves encoded data using the provided Extractor. If no data for this format was retrieved OR if the retrieved data is invalid, then the current Context is returned.

Implementors§