[−][src]Trait opentelemetry::api::labels::Encoder
Encoder is a mechanism for serializing a label set into a specific string representation that supports caching, to avoid repeated serialization. An example could be an exporter encoding the label set into a wire representation.
Required methods
fn encode(&self, labels: &mut dyn Iterator<Item = (&Key, &Value)>) -> String
Encode returns the serialized encoding of the label set using its Iterator. This result may be cached.
fn id(&self) -> EncoderId
A value that is unique for each class of label encoder. Label encoders
allocate these using new_encoder_id
.