rust_dynamic 0.49.0

Support for dynamically-typed values in run-time
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use serde::{Deserialize, Serialize};
use crate::value::{timestamp_ns};

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Metric {
    pub stamp:  u128,
    pub data:   f64,
}


impl Metric {
    pub fn new(value: f64) -> Self {
        Self {
            stamp:  timestamp_ns(),
            data:   value,
        }
    }
}