Skip to main content

encode_metric_data_into

Function encode_metric_data_into 

Source
pub fn encode_metric_data_into(
    buf: &mut Vec<u8>,
    metrics: &[MetricEntryParams<'_>],
) -> Range<usize>
Expand description

Encode multiple metric entries directly into a caller-owned buffer as a MetricData FlatBuffer.

Zero-copy: writes the header first with reserved offset slots, then encodes entries directly in their final position. No intermediate allocations or copies. The caller can reuse buf across flushes via buf.clear().

Returns the range start..buf.len() of the MetricData bytes within buf.