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) -> Self
pub fn with_backend( config: RateLimitConfig, backend: Arc<dyn RateLimitBackend>, ) -> Self
pub fn key(self, key: impl RateLimitKey) -> Self
pub const fn failure_mode(self, mode: RateLimitFailureMode) -> Self
pub fn metrics(self, metrics: Metrics) -> Self
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