pub struct Notifier { /* private fields */ }Expand description
Dispatches notifications to all configured channels.
Implementations§
Source§impl Notifier
impl Notifier
Sourcepub fn new(channels: Vec<NotificationChannel>) -> Self
pub fn new(channels: Vec<NotificationChannel>) -> Self
Create a notifier with the given channels.
Sourcepub fn from_config(config: &ObservabilityConfig) -> Self
pub fn from_config(config: &ObservabilityConfig) -> Self
Build a notifier from cluster observability config.
Reads observability.alerts.webhook and observability.alerts.email fields.
Sourcepub async fn send(&self, title: &str, message: &str, severity: &str)
pub async fn send(&self, title: &str, message: &str, severity: &str)
Send a notification to all configured channels.
severity is informational (e.g. “info”, “warning”, “critical”).
Failures on individual channels are logged but do not abort the remaining sends.
Sourcepub fn channel_count(&self) -> usize
pub fn channel_count(&self) -> usize
Returns the number of configured channels.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Notifier
impl !RefUnwindSafe for Notifier
impl Send for Notifier
impl Sync for Notifier
impl Unpin for Notifier
impl UnsafeUnpin for Notifier
impl !UnwindSafe for Notifier
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