pub trait WithHttpConfig {
// Required methods
fn with_http_client<T: HttpClient + 'static>(self, client: T) -> Self;
fn with_headers(self, headers: HashMap<String, String>) -> Self;
}
Available on crate features
http-proto
or http-json
only.Expand description
This trait will be implemented for every struct that implemented HasHttpConfig
trait.
§Examples
use crate::opentelemetry_otlp::WithHttpConfig;
let exporter_builder = opentelemetry_otlp::SpanExporter::builder()
.with_http()
.with_headers(std::collections::HashMap::new());
Required Methods§
Sourcefn with_http_client<T: HttpClient + 'static>(self, client: T) -> Self
fn with_http_client<T: HttpClient + 'static>(self, client: T) -> Self
Assign client implementation
Sourcefn with_headers(self, headers: HashMap<String, String>) -> Self
fn with_headers(self, headers: HashMap<String, String>) -> Self
Set additional headers to send to the collector.
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.