pub struct AlertLog { /* private fields */ }Expand description
The alerts of every host as they appear and clear, so that what happened while nobody watched can be looked up later.
Implementations§
Source§impl AlertLog
impl AlertLog
Sourcepub fn persistent(path: PathBuf) -> Self
pub fn persistent(path: PathBuf) -> Self
A log kept in path: the events of earlier runs are loaded, alerts
they left raised count as still present (so a restart does not log
them again), and new events are appended. A file that cannot be
read or written leaves the log working in memory.
Sourcepub fn update(&mut self, host: &str, alerts: &[Alert], at_ms: u64)
pub fn update(&mut self, host: &str, alerts: &[Alert], at_ms: u64)
Records how the alerts of host changed since its previous update.
Sourcepub fn events(&self) -> impl DoubleEndedIterator<Item = &AlertEvent>
pub fn events(&self) -> impl DoubleEndedIterator<Item = &AlertEvent>
All events, oldest first.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AlertLog
impl RefUnwindSafe for AlertLog
impl Send for AlertLog
impl Sync for AlertLog
impl Unpin for AlertLog
impl UnsafeUnpin for AlertLog
impl UnwindSafe for AlertLog
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