pub struct RateLimitConfig {
pub requests_per_second: f64,
pub burst_size: u32,
pub respect_retry_after: bool,
pub clock: Clock,
}Expand description
The budget a client holds itself to, and whether it takes HEY’s word over its own.
A rate or a burst that is not positive reads as “leave it at the default”, the same normalising Go does.
Fields§
§requests_per_second: f64How fast the bucket refills.
burst_size: u32How many requests can go out at once from a full bucket.
respect_retry_after: boolWhether a Retry-After from HEY holds the limiter back until it has passed.
clock: ClockWhere the limiter reads the time; see Clock.
Trait Implementations§
Source§impl Clone for RateLimitConfig
impl Clone for RateLimitConfig
Source§fn clone(&self) -> RateLimitConfig
fn clone(&self) -> RateLimitConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RateLimitConfig
impl Debug for RateLimitConfig
Source§impl Default for RateLimitConfig
impl Default for RateLimitConfig
Source§fn default() -> RateLimitConfig
fn default() -> RateLimitConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for RateLimitConfig
impl !UnwindSafe for RateLimitConfig
impl Freeze for RateLimitConfig
impl Send for RateLimitConfig
impl Sync for RateLimitConfig
impl Unpin for RateLimitConfig
impl UnsafeUnpin for RateLimitConfig
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