Skip to main content

AlertSink

Trait AlertSink 

Source
pub trait AlertSink: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn send(&self, alert: &Alert) -> Result<()>;

    // Provided methods
    fn flush(&self) -> Result<()> { ... }
    fn handles_tags(&self) -> &[String] { ... }
}
Expand description

Trait for alert output sinks

Implement this trait to create custom alert destinations.

CLI-specific sinks (like ConsoleSink) should be implemented in shape-cli.

Required Methods§

Source

fn name(&self) -> &str

Get the sink name

Source

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

Send an alert to this sink

Provided Methods§

Source

fn flush(&self) -> Result<()>

Flush any pending alerts

Source

fn handles_tags(&self) -> &[String]

Get the tags this sink handles

Returns an empty slice to handle all alerts.

Implementors§