Function should_perform_full_reset

Source
pub fn should_perform_full_reset(
    elapsed: Duration,
    window_duration: Duration,
) -> bool
Expand description

Check if enough time has passed for a full window reset

This is a common check across rate limiters to determine if the window has completely elapsed and tokens should be reset to maximum.

§Arguments

  • elapsed - Time elapsed since last refresh
  • window_duration - Duration of the rate limiting window

§Returns

True if a full window reset should occur