pub struct RateLimiter { /* private fields */ }Expand description
Thread-safe rate limiter state shared across all connections.
Wraps a HashMap mapping IP addresses to their rate limit entries.
Uses tokio::sync::Mutex for async-friendly locking that won’t block
the Tokio thread pool.
§Example
use wisegate_core::RateLimiter;
let limiter = RateLimiter::new();Implementations§
Source§impl RateLimiter
impl RateLimiter
Sourcepub fn new() -> RateLimiter
pub fn new() -> RateLimiter
Creates a new empty rate limiter.
Trait Implementations§
Source§impl Clone for RateLimiter
impl Clone for RateLimiter
Source§fn clone(&self) -> RateLimiter
fn clone(&self) -> RateLimiter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for RateLimiter
impl Default for RateLimiter
Source§fn default() -> RateLimiter
fn default() -> RateLimiter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RateLimiter
impl !RefUnwindSafe for RateLimiter
impl Send for RateLimiter
impl Sync for RateLimiter
impl Unpin for RateLimiter
impl UnsafeUnpin for RateLimiter
impl !UnwindSafe 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