pub struct RestRateLimiter { /* private fields */ }Implementations§
Source§impl RestRateLimiter
impl RestRateLimiter
pub fn new() -> Self
Sourcepub async fn acquire(&self, weight: u32) -> Result<(), RateLimitError>
pub async fn acquire(&self, weight: u32) -> Result<(), RateLimitError>
Returns Err(RateLimitError) immediately if the weight budget is exhausted.
Sourcepub async fn acquire_blocking(&self, weight: u32)
pub async fn acquire_blocking(&self, weight: u32)
Retries on Err, logging each wait. Resolves once the request is accepted.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RestRateLimiter
impl !RefUnwindSafe for RestRateLimiter
impl Send for RestRateLimiter
impl Sync for RestRateLimiter
impl Unpin for RestRateLimiter
impl UnsafeUnpin for RestRateLimiter
impl UnwindSafe for RestRateLimiter
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