pub struct StoredReading {
pub id: i64,
pub device_id: String,
pub captured_at: OffsetDateTime,
pub co2: u16,
pub temperature: f32,
pub pressure: f32,
pub humidity: u8,
pub battery: u8,
pub status: Status,
pub radon: Option<u32>,
pub radiation_rate: Option<f32>,
pub radiation_total: Option<f64>,
}Expand description
A reading stored in the database.
Fields§
§id: i64Database row ID.
device_id: StringDevice identifier.
captured_at: OffsetDateTimeWhen this reading was captured.
co2: u16CO2 concentration in ppm.
temperature: f32Temperature in Celsius.
pressure: f32Pressure in hPa.
humidity: u8Humidity percentage.
battery: u8Battery percentage.
status: StatusStatus indicator.
radon: Option<u32>Radon level (Bq/m3) for radon devices.
radiation_rate: Option<f32>Radiation rate in uSv/h for radiation devices.
radiation_total: Option<f64>Total radiation dose in mSv for radiation devices.
Implementations§
Source§impl StoredReading
impl StoredReading
Sourcepub fn from_reading(device_id: &str, reading: &CurrentReading) -> Self
pub fn from_reading(device_id: &str, reading: &CurrentReading) -> Self
Create a StoredReading from a CurrentReading.
Sourcepub fn to_reading(&self) -> CurrentReading
pub fn to_reading(&self) -> CurrentReading
Convert to a CurrentReading.
Trait Implementations§
Source§impl Clone for StoredReading
impl Clone for StoredReading
Source§fn clone(&self) -> StoredReading
fn clone(&self) -> StoredReading
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 StoredReading
impl Debug for StoredReading
Source§impl<'de> Deserialize<'de> for StoredReading
impl<'de> Deserialize<'de> for StoredReading
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
Auto Trait Implementations§
impl Freeze for StoredReading
impl RefUnwindSafe for StoredReading
impl Send for StoredReading
impl Sync for StoredReading
impl Unpin for StoredReading
impl UnwindSafe for StoredReading
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