pub struct Notifier { /* private fields */ }Expand description
Dispatches agent events to Discord and/or JSONL log files.
Implementations§
Source§impl Notifier
impl Notifier
Sourcepub fn from_config(config: &NotifierSection) -> Self
pub fn from_config(config: &NotifierSection) -> Self
Build a Notifier from the config section.
Sourcepub async fn notify(&self, event: &AgentEvent) -> Result<(), NotifierError>
pub async fn notify(&self, event: &AgentEvent) -> Result<(), NotifierError>
Send an event to all configured sinks.
JSONL is always written (if log_dir is set).
Discord is skipped during quiet hours.
Sourcepub fn is_quiet_hours(&self) -> bool
pub fn is_quiet_hours(&self) -> bool
Returns true if the current local time falls within the quiet window.
Quiet hours wrap around midnight when quiet_start > quiet_end
(e.g. 23:00 - 08:00).
Sourcepub fn is_quiet_hours_at(&self, now: NaiveTime) -> bool
pub fn is_quiet_hours_at(&self, now: NaiveTime) -> bool
Testable version that accepts an explicit time.
Sourcepub fn build_discord_payload(&self, event: &AgentEvent) -> Value
pub fn build_discord_payload(&self, event: &AgentEvent) -> Value
Build the Discord webhook JSON payload (embeds format).
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