Trait Flatten
pub trait Flatten {
// Required method
fn flatten(&self, buffer: &mut impl MetricBuffer);
}Expand description
Allows a type to emit its telemetry representation as key-value pairs into a MetricBuffer.
Each call to flatten should write one or more entries into the buffer,
where each entry is a static key and a Value.
For primitive types (e.g. u8, f32, bool), a default implementation is provided that
emits a single "value" key. Composite types should implement this trait to emit one entry
per field. Types that do not produce telemetry can provide an empty implementation.
Required Methods§
fn flatten(&self, buffer: &mut impl MetricBuffer)
fn flatten(&self, buffer: &mut impl MetricBuffer)
Writes telemetry key-value pairs into the given buffer.
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.