pub struct AlertCondition {
pub operator: ComparisonOperator,
pub threshold: f64,
pub duration_seconds: u64,
}Expand description
Alert condition for triggering alerts
Fields§
§operator: ComparisonOperatorComparison operator
threshold: f64Threshold value
duration_seconds: u64Duration the condition must be true before triggering (in seconds)
Implementations§
Source§impl AlertCondition
impl AlertCondition
Sourcepub fn new(
operator: ComparisonOperator,
threshold: f64,
duration_seconds: u64,
) -> Self
pub fn new( operator: ComparisonOperator, threshold: f64, duration_seconds: u64, ) -> Self
Create a new alert condition
Sourcepub fn is_satisfied(&self, value: f64) -> bool
pub fn is_satisfied(&self, value: f64) -> bool
Check if a value satisfies this condition
Trait Implementations§
Source§impl Clone for AlertCondition
impl Clone for AlertCondition
Source§fn clone(&self) -> AlertCondition
fn clone(&self) -> AlertCondition
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 AlertCondition
impl Debug for AlertCondition
Source§impl<'de> Deserialize<'de> for AlertCondition
impl<'de> Deserialize<'de> for AlertCondition
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 AlertCondition
impl RefUnwindSafe for AlertCondition
impl Send for AlertCondition
impl Sync for AlertCondition
impl Unpin for AlertCondition
impl UnwindSafe for AlertCondition
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