pub struct AlertManager { /* private fields */ }Expand description
Alert manager for monitoring events and triggering alerts
Implementations§
Source§impl AlertManager
impl AlertManager
Sourcepub async fn register<H: AlertHandler + 'static>(
&self,
condition: AlertCondition,
severity: AlertSeverity,
title: impl Into<String>,
handler: H,
)
pub async fn register<H: AlertHandler + 'static>( &self, condition: AlertCondition, severity: AlertSeverity, title: impl Into<String>, handler: H, )
Register an alert handler
Sourcepub async fn process_event(&self, event: Event) -> Result<()>
pub async fn process_event(&self, event: Event) -> Result<()>
Process an event and trigger alerts if conditions match
§Errors
Returns an error if any alert handler fails to process the alert.
Sourcepub async fn handler_count(&self) -> usize
pub async fn handler_count(&self) -> usize
Get the number of registered alert handlers
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AlertManager
impl !RefUnwindSafe for AlertManager
impl Send for AlertManager
impl Sync for AlertManager
impl Unpin for AlertManager
impl !UnwindSafe for AlertManager
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