use super::metric_snapshot_formatter::MetricSnapshotFormatter;
use crate::model::ProgressMetricSnapshot;
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
pub struct JsonMetricSnapshotFormatter;
impl JsonMetricSnapshotFormatter {
#[inline]
pub const fn new() -> Self {
Self
}
}
impl MetricSnapshotFormatter for JsonMetricSnapshotFormatter {
#[inline]
fn format(&self, snapshot: &ProgressMetricSnapshot) -> String {
serde_json::to_string(snapshot).expect("progress metric snapshot should serialize")
}
}