pub struct CurrentReadingBuilder { /* private fields */ }Expand description
Implementations§
Source§impl CurrentReadingBuilder
impl CurrentReadingBuilder
Sourcepub fn temperature(self, temp: f32) -> Self
pub fn temperature(self, temp: f32) -> Self
Set temperature.
Sourcepub fn captured_at(self, timestamp: OffsetDateTime) -> Self
pub fn captured_at(self, timestamp: OffsetDateTime) -> Self
Set the captured timestamp.
Sourcepub fn radiation_rate(self, rate: f32) -> Self
pub fn radiation_rate(self, rate: f32) -> Self
Set radiation dose rate (Aranet Radiation).
Sourcepub fn radiation_total(self, total: f64) -> Self
pub fn radiation_total(self, total: f64) -> Self
Set total radiation dose (Aranet Radiation).
Sourcepub fn radon_avg_24h(self, avg: u32) -> Self
pub fn radon_avg_24h(self, avg: u32) -> Self
Set 24-hour average radon concentration (AranetRn+).
Sourcepub fn radon_avg_7d(self, avg: u32) -> Self
pub fn radon_avg_7d(self, avg: u32) -> Self
Set 7-day average radon concentration (AranetRn+).
Sourcepub fn radon_avg_30d(self, avg: u32) -> Self
pub fn radon_avg_30d(self, avg: u32) -> Self
Set 30-day average radon concentration (AranetRn+).
Sourcepub fn build(self) -> CurrentReading
pub fn build(self) -> CurrentReading
Build the CurrentReading without validation.
Sourcepub fn try_build(self) -> Result<CurrentReading, ParseError>
pub fn try_build(self) -> Result<CurrentReading, ParseError>
Build the CurrentReading with validation.
Validates:
humidityis 0-100batteryis 0-100temperatureis within reasonable range (-40 to 100°C)pressureis within reasonable range (800-1200 hPa) or 0
§Errors
Returns ParseError::InvalidValue if any field has an invalid value.
Trait Implementations§
Source§impl Debug for CurrentReadingBuilder
impl Debug for CurrentReadingBuilder
Source§impl Default for CurrentReadingBuilder
impl Default for CurrentReadingBuilder
Source§fn default() -> CurrentReadingBuilder
fn default() -> CurrentReadingBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CurrentReadingBuilder
impl RefUnwindSafe for CurrentReadingBuilder
impl Send for CurrentReadingBuilder
impl Sync for CurrentReadingBuilder
impl Unpin for CurrentReadingBuilder
impl UnwindSafe for CurrentReadingBuilder
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