#[non_exhaustive]pub enum MetricValue {
Double(f64),
String(String),
Long(i64),
Int(i32),
}Expand description
The type-erased value of a metric.
Java’s Metric.metricValue() returns Object, which may be a measurable
Double or a non-measurable gauge value of any type. This enum captures the
value kinds the consumer metrics produce.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Double(f64)
A measurable (or Double-valued gauge) reading.
String(String)
A string-valued gauge reading.
Long(i64)
A long-valued gauge reading.
Int(i32)
An integer-valued gauge reading.
Implementations§
Source§impl MetricValue
impl MetricValue
Sourcepub fn as_double(&self) -> Option<f64>
pub fn as_double(&self) -> Option<f64>
Returns the value as an f64 if it is a MetricValue::Double.
Trait Implementations§
Source§impl Clone for MetricValue
impl Clone for MetricValue
Source§fn clone(&self) -> MetricValue
fn clone(&self) -> MetricValue
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MetricValue
impl Debug for MetricValue
Source§impl PartialEq for MetricValue
impl PartialEq for MetricValue
impl StructuralPartialEq for MetricValue
Auto Trait Implementations§
impl Freeze for MetricValue
impl RefUnwindSafe for MetricValue
impl Send for MetricValue
impl Sync for MetricValue
impl Unpin for MetricValue
impl UnsafeUnpin for MetricValue
impl UnwindSafe for MetricValue
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