Skip to main content

AlertHook

Trait AlertHook 

Source
pub trait AlertHook: Send + Sync {
    // Required method
    fn notify(&self, alert: &Alert) -> Result<(), String>;
}
Expand description

Alert dispatch hook. Implementations can write alerts to logs, send them to a webhook, push them to IM, etc.

Must implement Send + Sync so it can be shared as Arc<dyn AlertHook> in multi-threaded environments.

Required Methods§

Source

fn notify(&self, alert: &Alert) -> Result<(), String>

Handles an alert event. Returns Ok(()) on success, or an error description string on failure.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§