pub struct LoopDetector { /* private fields */ }Expand description
Sliding-window loop detector.
Implementations§
Source§impl LoopDetector
impl LoopDetector
Sourcepub fn new(window: usize, threshold: u32) -> Self
pub fn new(window: usize, threshold: u32) -> Self
Build a detector with the given sliding window size and trip threshold.
Sourcepub fn record(&mut self, tool: &str, args_fingerprint: &str) -> bool
pub fn record(&mut self, tool: &str, args_fingerprint: &str) -> bool
Record one invocation. Returns true when this invocation pushed
(tool, args_fingerprint) to or past the trip threshold.
Sourcepub fn is_looping(&self) -> bool
pub fn is_looping(&self) -> bool
True when any tuple is currently at or past the threshold.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LoopDetector
impl RefUnwindSafe for LoopDetector
impl Send for LoopDetector
impl Sync for LoopDetector
impl Unpin for LoopDetector
impl UnsafeUnpin for LoopDetector
impl UnwindSafe for LoopDetector
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