pub enum Alert {
OutOfRange {
reading: f32,
},
RunningOut {
samples: u32,
},
ChangingFast {
rate: f32,
},
}Expand description
An alert raised when a reading crosses a profile’s safety threshold.
Variants§
OutOfRange
A controlled reading drifted outside its safe band.
For a cold-chain fridge this is a spoilage excursion: the cooler may be running, but the contents are no longer within the safe temperature range.
RunningOut
A falling level will reach its empty mark within this many more samples.
ChangingFast
A reading is changing faster than its safe rate.
For a river gauge this is a flash-flood warning: the level jumped further in one sample than the profile allows.
Implementations§
Source§impl Alert
impl Alert
Sourcepub fn kind(self) -> &'static str
pub fn kind(self) -> &'static str
Returns the name of the condition, without the measurement that triggered it.
The bindings carry an alert as a kind and a value, so this is the same word in every language, which is what lets one reading be logged or compared the same way wherever the node’s code is written.
§Returns
One of "OutOfRange", "RunningOut", or "ChangingFast".