pub struct Measurement {
pub timestamp: DateTime<Utc>,
pub conductivity: Option<Conductivity>,
pub temperature: Option<Temperature>,
}Expand description
measurement point
Both conductivity and temperature can be a successful or failed measurement, hence the Option types.
There is a success-guaranteed counterpart of this type SuccessfulMeasurement.
call crate::Device::latest_measurement() to fetch the latest measurement
§Example
use islabtech_upw_sensor_v1::measurements::Measurement;
Measurement {
timestamp: chrono::DateTime::from_timestamp(1716821872, 123456).unwrap(),
conductivity: Some(1.23.into()), // µS/cm
temperature: None, // `None` because temperature out of range or broken temperature sensor
};Fields§
§timestamp: DateTime<Utc>§conductivity: Option<Conductivity>§temperature: Option<Temperature>Trait Implementations§
Source§impl Clone for Measurement
impl Clone for Measurement
Source§fn clone(&self) -> Measurement
fn clone(&self) -> Measurement
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 Measurement
impl Debug for Measurement
Source§impl<'de> Deserialize<'de> for Measurement
impl<'de> Deserialize<'de> for Measurement
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for Measurement
impl PartialEq for Measurement
Source§impl PartialOrd for Measurement
impl PartialOrd for Measurement
Source§impl Serialize for Measurement
impl Serialize for Measurement
impl StructuralPartialEq for Measurement
Auto Trait Implementations§
impl Freeze for Measurement
impl RefUnwindSafe for Measurement
impl Send for Measurement
impl Sync for Measurement
impl Unpin for Measurement
impl UnwindSafe for Measurement
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