Struct measured::text::TextEncoder
source · pub struct TextEncoder { /* private fields */ }Expand description
The prometheus text encoder helper
Implementations§
source§impl TextEncoder
impl TextEncoder
pub fn new() -> Self
sourcepub fn finish(&mut self) -> Bytes
pub fn finish(&mut self) -> Bytes
Finish the text encoding and extract the bytes to send in a HTTP response.
sourcepub fn write_help(&mut self, name: &impl MetricName, help: &str)
pub fn write_help(&mut self, name: &impl MetricName, help: &str)
Write the help line for a metric
sourcepub fn write_type(&mut self, name: &impl MetricName, typ: MetricType)
pub fn write_type(&mut self, name: &impl MetricName, typ: MetricType)
Write the type line for a metric
sourcepub fn write_metric<L: LabelGroup>(
&mut self,
name: &impl MetricName,
labels: L,
value: MetricValue
)
pub fn write_metric<L: LabelGroup>( &mut self, name: &impl MetricName, labels: L, value: MetricValue )
Write the metric data
Trait Implementations§
source§impl Default for TextEncoder
impl Default for TextEncoder
source§impl MetricEncoder<TextEncoder> for CounterState
impl MetricEncoder<TextEncoder> for CounterState
fn write_type(name: impl MetricName, enc: &mut TextEncoder)
fn collect_into( &self, _m: &(), labels: impl LabelGroup, name: impl MetricName, enc: &mut TextEncoder )
source§impl<const N: usize> MetricEncoder<TextEncoder> for HistogramState<N>
impl<const N: usize> MetricEncoder<TextEncoder> for HistogramState<N>
fn write_type(name: impl MetricName, enc: &mut TextEncoder)
fn collect_into( &self, metadata: &Thresholds<N>, labels: impl LabelGroup, name: impl MetricName, enc: &mut TextEncoder )
Auto Trait Implementations§
impl RefUnwindSafe for TextEncoder
impl Send for TextEncoder
impl Sync for TextEncoder
impl Unpin for TextEncoder
impl UnwindSafe for TextEncoder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more