pub struct RateLimiter { /* private fields */ }Expand description
Rate limiter for API requests.
Implementations§
Source§impl RateLimiter
impl RateLimiter
Sourcepub fn with_backoff_strategy(self, strategy: BackoffStrategy) -> Self
pub fn with_backoff_strategy(self, strategy: BackoffStrategy) -> Self
Set the backoff strategy.
Sourcepub async fn handle_rate_limit_error(&self, attempt: u32) -> Duration
pub async fn handle_rate_limit_error(&self, attempt: u32) -> Duration
Handle a rate limit error.
Auto Trait Implementations§
impl Freeze for RateLimiter
impl RefUnwindSafe for RateLimiter
impl Send for RateLimiter
impl Sync for RateLimiter
impl Unpin 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