pub struct RateLimiter { /* private fields */ }Expand description
Inner rate-limiting state shared behind a Mutex.
Implementations§
Source§impl RateLimiter
impl RateLimiter
pub fn new( requests_per_second: f64, burst_size: u32, max_tracked_ips: usize, ) -> RateLimiter
Sourcepub async fn tracked_ip_count(&self) -> usize
pub async fn tracked_ip_count(&self) -> usize
Current number of tracked client IPs (for tests).
Auto Trait Implementations§
impl !Freeze for RateLimiter
impl !RefUnwindSafe for RateLimiter
impl !UnwindSafe for RateLimiter
impl Send for RateLimiter
impl Sync for RateLimiter
impl Unpin for RateLimiter
impl UnsafeUnpin for RateLimiter
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