pub struct FailureTracker { /* private fields */ }Expand description
Per-domain, per-browser failure tracker with 10-minute TTL.
All methods are &self (no &mut self), making this safe to share
across tasks via Arc<FailureTracker>.
Implementations§
Source§impl FailureTracker
impl FailureTracker
Sourcepub fn record_failure(&self, domain: &str, browser: &str)
pub fn record_failure(&self, domain: &str, browser: &str)
Record a failure for a domain + browser pair.
Sourcepub fn record_success(&self, domain: &str, browser: &str)
pub fn record_success(&self, domain: &str, browser: &str)
Record a success – clears the failure counter for a domain + browser.
Sourcepub fn failure_count(&self, domain: &str, browser: &str) -> u32
pub fn failure_count(&self, domain: &str, browser: &str) -> u32
Get failure count (0 if expired or not found).
Sourcepub fn total_failure_count(&self, domain: &str) -> u32
pub fn total_failure_count(&self, domain: &str) -> u32
Get total failures across all browsers for a domain (unexpired only).
Trait Implementations§
Source§impl Debug for FailureTracker
impl Debug for FailureTracker
Source§impl Default for FailureTracker
impl Default for FailureTracker
Source§fn default() -> FailureTracker
fn default() -> FailureTracker
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FailureTracker
impl !RefUnwindSafe for FailureTracker
impl Send for FailureTracker
impl Sync for FailureTracker
impl Unpin for FailureTracker
impl UnsafeUnpin for FailureTracker
impl UnwindSafe for FailureTracker
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