pub struct RateLimiterBuilder { /* private fields */ }Expand description
Builder for creating customized RateLimiter instances
Implementations§
Source§impl RateLimiterBuilder
impl RateLimiterBuilder
Sourcepub fn strategy(self, strategy: RateLimitStrategyType) -> Self
pub fn strategy(self, strategy: RateLimitStrategyType) -> Self
Set the rate limiting strategy type
Sourcepub fn max_requests(self, max: usize) -> Self
pub fn max_requests(self, max: usize) -> Self
Set the maximum number of requests allowed in the time window
Sourcepub fn time_window(self, window: Duration) -> Self
pub fn time_window(self, window: Duration) -> Self
Set the time window for rate limiting
Sourcepub fn burst_size(self, size: usize) -> Self
pub fn burst_size(self, size: usize) -> Self
Set the burst size for temporary spikes
Sourcepub fn build(self) -> RateLimiter
pub fn build(self) -> RateLimiter
Build the RateLimiter
Trait Implementations§
Source§impl Debug for RateLimiterBuilder
impl Debug for RateLimiterBuilder
Source§impl Default for RateLimiterBuilder
impl Default for RateLimiterBuilder
Source§fn default() -> RateLimiterBuilder
fn default() -> RateLimiterBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RateLimiterBuilder
impl RefUnwindSafe for RateLimiterBuilder
impl Send for RateLimiterBuilder
impl Sync for RateLimiterBuilder
impl Unpin for RateLimiterBuilder
impl UnwindSafe for RateLimiterBuilder
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