rate_limit_wrapper

Crates.iorate_limit_wrapper
lib.rsrate_limit_wrapper
version0.2.0
created_at2025-07-30 09:24:59.372951+00
updated_at2025-07-30 09:46:25.693625+00
descriptionAsync rate limit wrapper to easily manage resources
homepage
repositoryhttps://github.com/nappa85/rate_limit_wrapper
max_upload_size
id1773295
size34,382
Marco Napetti (nappa85)

documentation

https://docs.rs/rate_limit_wrapper

README

Async rate limit implementation

Async rate limit wrapper to easily manage resources

Example

use std::time::Duration;
use rate_limit_wrapper::RateLimit;

#[tokio::main]
async fn main() {
  // 10 requests per second
  let rm = RateLimit::new(10, Duration::from_secs(1), reqwest::Client::new());

  // Access inner client bypassing rate limit
  let request = rm.as_ref().get("https://www.rust-lang.org").build().unwrap();

  // Apply rate limit
  let client = rm.rate_limit().await;
  client.execute(request).await.unwrap();
}
Commit count: 0

cargo fmt