Struct omnisensor::threshold::ThresholdBound
source · [−]pub struct ThresholdBound {
value: SignalProp<f64>,
hysteresis: f64,
alarm: SignalProp<bool>,
}
Expand description
Represents a single direction of a threshold.
Fields
value: SignalProp<f64>
The threshold value.
hysteresis: f64
alarm: SignalProp<bool>
Whether or not an alarm for the threshold is currently asserted.
Implementations
sourceimpl ThresholdBound
impl ThresholdBound
sourcefn new(
msgfns: &ThresholdBoundIntfMsgFns,
dbuspath: &Arc<SensorPath>,
conn: &Arc<SyncConnection>
) -> Self
fn new(
msgfns: &ThresholdBoundIntfMsgFns,
dbuspath: &Arc<SensorPath>,
conn: &Arc<SyncConnection>
) -> Self
Construct a ThresholdBound
for an object at dbuspath
using the given
msgfns
for generating PropertiesChanged
signal messages and sending them
via conn
.
sourcefn update(&mut self, kind: ThresholdBoundType, sample: f64)
fn update(&mut self, kind: ThresholdBoundType, sample: f64)
Update self
’s alarm state based on the given direction (kind
) and sample
value from the sensor.
Auto Trait Implementations
impl !RefUnwindSafe for ThresholdBound
impl Send for ThresholdBound
impl Sync for ThresholdBound
impl Unpin for ThresholdBound
impl !UnwindSafe for ThresholdBound
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more