pub trait Encoder: Debug {
// Required methods
fn encode(
&self,
attributes: &mut dyn Iterator<Item = (&Key, &Value)>,
) -> String;
fn id(&self) -> EncoderId;
}Available on crate feature
metrics only.Expand description
Encoder is a mechanism for serializing an attribute set into a specific string representation that supports caching, to avoid repeated serialization. An example could be an exporter encoding the attribute set into a wire representation.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".