pub struct EscalationBudget { /* private fields */ }Expand description
Per-scan ceiling on automatic escalation attempts.
Mirrors BrowserBudget in shape but is a
distinct type so the two caps are independent: a bot-protected site
that goes straight to the browser consumes crate::BrowserBudget; a site
that tries HTTP first and falls back to the browser consumes one of
each. Cheap to share across tasks.
Implementations§
Source§impl EscalationBudget
impl EscalationBudget
Sourcepub fn try_consume(&self) -> bool
pub fn try_consume(&self) -> bool
Atomically reserve one unit of budget.
Returns true if accepted, false once the cap is reached. The
compare-exchange loop guarantees used <= cap under concurrent
callers.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for EscalationBudget
impl RefUnwindSafe for EscalationBudget
impl Send for EscalationBudget
impl Sync for EscalationBudget
impl Unpin for EscalationBudget
impl UnsafeUnpin for EscalationBudget
impl UnwindSafe for EscalationBudget
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