pub struct RateLimiter<K: Eq + Hash> { /* private fields */ }Implementations§
Source§impl<K: Eq + Hash> RateLimiter<K>
impl<K: Eq + Hash> RateLimiter<K>
pub fn new(limit: usize, slots: usize) -> Arc<Self>
pub fn rotate_slots(&self)
pub fn check_limited(&self, key: K) -> bool
Auto Trait Implementations§
impl<K> !Freeze for RateLimiter<K>
impl<K> !RefUnwindSafe for RateLimiter<K>
impl<K> Send for RateLimiter<K>where
K: Send,
impl<K> Sync for RateLimiter<K>
impl<K> Unpin for RateLimiter<K>where
K: Unpin,
impl<K> UnwindSafe for RateLimiter<K>where
K: UnwindSafe,
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