Skip to main content

allow_request

Function allow_request 

Source
fn allow_request(
    num_recent_requests: &mut usize,
    last_request_count_reset_time: &mut Instant,
    now: impl FnOnce() -> Instant,
) -> bool
Expand description

Checks the request limit, reading the clock only after the counter reaches the limit.