pub enum MetricValue {
Double(f64),
Long(i64),
Histogram(MetricDistribution),
Vector(Vec<f64>),
String(String),
Boolean(bool),
Map(HashMap<String, MetricValue>),
}Expand description
Represents different types of metric values that analyzers can produce.
This enum covers all common metric types needed for data quality analysis, from simple scalars to complex distributions.
Variants§
Double(f64)
A floating-point metric value (e.g., mean, percentage).
Long(i64)
An integer metric value (e.g., count, size).
Histogram(MetricDistribution)
A histogram distribution of values.
Vector(Vec<f64>)
A vector of values (e.g., for multi-dimensional metrics).
String(String)
A string metric value (e.g., mode, most frequent value).
Boolean(bool)
A boolean metric value (e.g., presence/absence).
Map(HashMap<String, MetricValue>)
A map of string keys to metric values (e.g., grouped metrics).
Implementations§
Source§impl MetricValue
impl MetricValue
Sourcepub fn is_numeric(&self) -> bool
pub fn is_numeric(&self) -> bool
Checks if the metric value is numeric (Double or Long).
Sourcepub fn to_string_pretty(&self) -> String
pub fn to_string_pretty(&self) -> String
Returns a human-readable string representation of the metric value.
Trait Implementations§
Source§impl Clone for MetricValue
impl Clone for MetricValue
Source§fn clone(&self) -> MetricValue
fn clone(&self) -> MetricValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MetricValue
impl Debug for MetricValue
Source§impl<'de> Deserialize<'de> for MetricValue
impl<'de> Deserialize<'de> for MetricValue
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for MetricValue
impl Display for MetricValue
Source§impl From<&str> for MetricValue
Implementation for &str values.
impl From<&str> for MetricValue
Implementation for &str values.
Source§impl From<String> for MetricValue
Implementation for String values.
impl From<String> for MetricValue
Implementation for String values.
Source§impl From<bool> for MetricValue
Implementation for bool values.
impl From<bool> for MetricValue
Implementation for bool values.
Source§impl From<f64> for MetricValue
Implementation for f64 values.
impl From<f64> for MetricValue
Implementation for f64 values.
Source§impl From<i64> for MetricValue
Implementation for i64 values.
impl From<i64> for MetricValue
Implementation for i64 values.
Source§impl PartialEq for MetricValue
impl PartialEq for MetricValue
Source§impl Serialize for MetricValue
impl Serialize for MetricValue
impl AnalyzerMetric for MetricValue
Blanket implementation for MetricValue itself.
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more