Skip to main content

Flatten

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)

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.

Implementations on Foreign Types§

§

impl Flatten for bool

§

fn flatten(&self, buffer: &mut impl MetricBuffer)

§

impl Flatten for f32

§

fn flatten(&self, buffer: &mut impl MetricBuffer)

§

impl Flatten for f64

§

fn flatten(&self, buffer: &mut impl MetricBuffer)

§

impl Flatten for i8

§

fn flatten(&self, buffer: &mut impl MetricBuffer)

§

impl Flatten for i16

§

fn flatten(&self, buffer: &mut impl MetricBuffer)

§

impl Flatten for i32

§

fn flatten(&self, buffer: &mut impl MetricBuffer)

§

impl Flatten for i64

§

fn flatten(&self, buffer: &mut impl MetricBuffer)

§

impl Flatten for u8

§

fn flatten(&self, buffer: &mut impl MetricBuffer)

§

impl Flatten for u16

§

fn flatten(&self, buffer: &mut impl MetricBuffer)

§

impl Flatten for u32

§

fn flatten(&self, buffer: &mut impl MetricBuffer)

§

impl<T, const N: usize> Flatten for [T; N]
where T: Flatten,

§

fn flatten(&self, buffer: &mut impl MetricBuffer)

Implementors§

Source§

impl Flatten for Frame

§

impl<T> Flatten for Chunk<'_, T>
where T: Flatten,