pub struct Thresholds { /* private fields */ }Expand description
Threshold evaluator for sensor readings.
Implementations§
Source§impl Thresholds
impl Thresholds
Sourcepub fn new(config: ThresholdConfig) -> Self
pub fn new(config: ThresholdConfig) -> Self
Create a new threshold evaluator with the given configuration.
Sourcepub fn config(&self) -> &ThresholdConfig
pub fn config(&self) -> &ThresholdConfig
Get the configuration.
Sourcepub fn evaluate_co2(&self, co2_ppm: u16) -> Co2Level
pub fn evaluate_co2(&self, co2_ppm: u16) -> Co2Level
Evaluate the CO2 level from a reading.
Sourcepub fn evaluate_reading(&self, reading: &CurrentReading) -> Co2Level
pub fn evaluate_reading(&self, reading: &CurrentReading) -> Co2Level
Evaluate the CO2 level from a CurrentReading.
Sourcepub fn exceeds_threshold(&self, co2_ppm: u16, level: Co2Level) -> bool
pub fn exceeds_threshold(&self, co2_ppm: u16, level: Co2Level) -> bool
Check if a CO2 reading exceeds a specific threshold.
Trait Implementations§
Source§impl Clone for Thresholds
impl Clone for Thresholds
Source§fn clone(&self) -> Thresholds
fn clone(&self) -> Thresholds
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 Thresholds
impl Debug for Thresholds
Source§impl Default for Thresholds
impl Default for Thresholds
Source§fn default() -> Thresholds
fn default() -> Thresholds
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Thresholds
impl RefUnwindSafe for Thresholds
impl Send for Thresholds
impl Sync for Thresholds
impl Unpin for Thresholds
impl UnwindSafe for Thresholds
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