Skip to main content

made_core/value_objects/
metric_label_value.rs

1/// A Prometheus label value.
2#[derive(Clone, Debug, PartialEq, Eq)]
3pub struct MetricLabelValue(String);
4
5impl MetricLabelValue {
6    #[must_use]
7    pub fn new(value: impl Into<String>) -> Self {
8        Self(value.into())
9    }
10
11    #[must_use]
12    pub fn as_str(&self) -> &str {
13        &self.0
14    }
15}