Skip to main content

HeaderBag

Trait HeaderBag 

pub trait HeaderBag:
    Clone
    + Default
    + Debug
    + Send
    + Sync
    + 'static {
    // Required methods
    fn merge(&mut self, other: Self);
    fn from_env(
        raw: &str,
        var: &'static str,
    ) -> Result<Self, OtelExporterConfigError>;
}
Available on crate features grpc and http and opentelemetry only.
Expand description

Abstraction over the header/metadata that works for http/grpc transport

Implemented for rama_http::HeaderMap (HTTP exporter) and crate::metadata::MetadataMap (gRPC exporter).

Required Methods§

fn merge(&mut self, other: Self)

Merge other into self, with other entries winning on conflict.

fn from_env( raw: &str, var: &'static str, ) -> Result<Self, OtelExporterConfigError>

Parse an OTEL_EXPORTER_OTLP_*_HEADERS env var value into a header bag. var is the env var name.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§