pub fn cleanup_timestamps_by_duration(
timestamps: &mut Vec<Instant>,
window_duration: Duration,
now: Instant,
) -> usizeExpand description
Clean up timestamps older than the specified duration from now
Convenience function that calculates the cutoff time based on the current time and a duration, then calls cleanup_old_timestamps.
§Arguments
timestamps- Mutable reference to a vector of timestampswindow_duration- Duration of the rate limiting windownow- Current time instant
§Returns
The number of timestamps that were removed