[][src]Trait opentelemetry::labels::Encoder

pub trait Encoder: Debug {
    pub fn encode(
        &self,
        labels: &mut dyn Iterator<Item = (&Key, &Value)>
    ) -> String;
pub fn id(&self) -> EncoderId; }
This is supported on crate feature metrics only.

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

pub fn encode(&self, labels: &mut dyn Iterator<Item = (&Key, &Value)>) -> String[src]

Encode returns the serialized encoding of the label set using its Iterator. This result may be cached.

pub fn id(&self) -> EncoderId[src]

A value that is unique for each class of label encoder. Label encoders allocate these using new_encoder_id.

Loading content...

Implementors

impl Encoder for DefaultLabelEncoder[src]

Loading content...