#[non_exhaustive]pub struct Metric {
pub name: String,
pub value: Option<Value>,
/* private fields */
}Expand description
Progress metric is (string, int|float|string) pair.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringRequired. Metric name, e.g., “nodes total”, “percent done”.
value: Option<Value>Strictly one of the values is required.
Implementations§
Source§impl Metric
impl Metric
pub fn new() -> Self
Sourcepub fn int_value(&self) -> Option<&i64>
pub fn int_value(&self) -> Option<&i64>
The value of value
if it holds a IntValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_int_value<T: Into<i64>>(self, v: T) -> Self
pub fn set_int_value<T: Into<i64>>(self, v: T) -> Self
Sourcepub fn double_value(&self) -> Option<&f64>
pub fn double_value(&self) -> Option<&f64>
The value of value
if it holds a DoubleValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_double_value<T: Into<f64>>(self, v: T) -> Self
pub fn set_double_value<T: Into<f64>>(self, v: T) -> Self
Sourcepub fn string_value(&self) -> Option<&String>
pub fn string_value(&self) -> Option<&String>
The value of value
if it holds a StringValue, None if the field is not set or
holds a different branch.
Sourcepub fn set_string_value<T: Into<String>>(self, v: T) -> Self
pub fn set_string_value<T: Into<String>>(self, v: T) -> Self
Trait Implementations§
impl StructuralPartialEq for Metric
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