pub struct Metric {
pub name: &'static str,
pub attributes: Vec<(&'static str, MetricAttributeValue)>,
pub ty: MetricType,
pub value: MetricValue,
pub unit: Option<&'static str>,
pub description: Option<&'static str>,
}Expand description
Represents a metric with its name, attributes, and value.
Fields§
§name: &'static strName of the metric
attributes: Vec<(&'static str, MetricAttributeValue)>Attributes of the metric
ty: MetricTypeType of the metric
value: MetricValueValue of the metric
unit: Option<&'static str>Optional unit of the metric
description: Option<&'static str>Optional description of the metric
Implementations§
Source§impl Metric
impl Metric
Sourcepub fn new(
name: &'static str,
attributes: Vec<(&'static str, MetricAttributeValue)>,
ty: MetricType,
value: MetricValue,
unit: Option<&'static str>,
description: Option<&'static str>,
) -> Self
pub fn new( name: &'static str, attributes: Vec<(&'static str, MetricAttributeValue)>, ty: MetricType, value: MetricValue, unit: Option<&'static str>, description: Option<&'static str>, ) -> Self
Creates a new instance of Metric
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Metric
impl RefUnwindSafe for Metric
impl Send for Metric
impl Sync for Metric
impl Unpin for Metric
impl UnwindSafe for Metric
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