pub struct AlertDeduplicator { /* private fields */ }Expand description
Tracks event IDs already admitted so repeated recalculation (e.g. rollback/idempotent replay of the same bar) does not re-emit duplicate alerts downstream.
Implementations§
Source§impl AlertDeduplicator
impl AlertDeduplicator
pub fn new() -> Self
Sourcepub fn admit(&mut self, event: &AlertEvent) -> bool
pub fn admit(&mut self, event: &AlertEvent) -> bool
Returns true and records the event if its ID has not been seen before; returns false
without side effects if it is a duplicate.
pub fn reset(&mut self)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for AlertDeduplicator
impl Clone for AlertDeduplicator
Source§fn clone(&self) -> AlertDeduplicator
fn clone(&self) -> AlertDeduplicator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AlertDeduplicator
impl Debug for AlertDeduplicator
Source§impl Default for AlertDeduplicator
impl Default for AlertDeduplicator
Source§fn default() -> AlertDeduplicator
fn default() -> AlertDeduplicator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AlertDeduplicator
impl RefUnwindSafe for AlertDeduplicator
impl Send for AlertDeduplicator
impl Sync for AlertDeduplicator
impl Unpin for AlertDeduplicator
impl UnsafeUnpin for AlertDeduplicator
impl UnwindSafe for AlertDeduplicator
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