pub enum AlertCondition {
EventType(String),
TaskFailed,
TaskRetryExceeded(u32),
WorkerOffline,
RateExceeds {
threshold: f64,
window_secs: u64,
},
Custom(Arc<dyn Fn(&Event) -> bool + Send + Sync>),
}Expand description
Event alert condition for triggering notifications
Variants§
EventType(String)
Alert on specific event type
TaskFailed
Alert when task fails
TaskRetryExceeded(u32)
Alert when task exceeds retry count
WorkerOffline
Alert when worker goes offline
RateExceeds
Alert when event rate exceeds threshold (events per second)
Custom(Arc<dyn Fn(&Event) -> bool + Send + Sync>)
Alert on custom condition
Implementations§
Source§impl AlertCondition
impl AlertCondition
Sourcepub fn check(&self, event: &Event, context: &AlertContext) -> bool
pub fn check(&self, event: &Event, context: &AlertContext) -> bool
Check if an event triggers this alert 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 moreAuto 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