Skip to main content

EncodeLabelValue

Trait EncodeLabelValue 

Source
pub trait EncodeLabelValue {
    // Required method
    fn encode_label_value(&self) -> LabelValue<'_>;
}
Expand description

Encodes a single field as a LabelValue.

Implemented for the standard label-supported types so the #[derive(EncodeLabelSet)] macro can borrow string fields without allocating on each scrape.

Required Methods§

Source

fn encode_label_value(&self) -> LabelValue<'_>

Borrows or copies self into a LabelValue.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl EncodeLabelValue for String

Source§

impl EncodeLabelValue for bool

Source§

impl EncodeLabelValue for i8

Source§

impl EncodeLabelValue for i16

Source§

impl EncodeLabelValue for i32

Source§

impl EncodeLabelValue for i64

Source§

impl EncodeLabelValue for str

Source§

impl EncodeLabelValue for u8

Source§

impl EncodeLabelValue for u16

Source§

impl EncodeLabelValue for u32

Source§

impl EncodeLabelValue for u64

Source§

impl<T: EncodeLabelValue + ?Sized> EncodeLabelValue for &T

Implementors§