pub struct RateLimit { /* private fields */ }Expand description
Distributed-capable fixed-window limiter with an atomic backend contract.
Implementations§
Source§impl RateLimit
impl RateLimit
pub fn new(config: RateLimitConfig) -> RateLimit
pub fn with_backend( config: RateLimitConfig, backend: Arc<dyn RateLimitBackend>, ) -> RateLimit
pub fn key(self, key: impl RateLimitKey) -> RateLimit
pub const fn failure_mode(self, mode: RateLimitFailureMode) -> RateLimit
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RateLimit
impl !UnwindSafe for RateLimit
impl Freeze for RateLimit
impl Send for RateLimit
impl Sync for RateLimit
impl Unpin for RateLimit
impl UnsafeUnpin for RateLimit
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