surf-governor

A rate-limiting middleware for surf

Install

With cargo add installed :

sh cargo add surf-governor

Documentation

Example

```rust use surf_governor::GovernorMiddleware; use surf::{Client, Request, http::Method}; use url::Url;

#[asyncstd::main] async fn main() -> surf::Result<()> { let req = Request::new(Method::Get, Url::parse("https://example.api")?); let client = Client::new().with(GovernorMiddleware::persecond(1)?); let res = client.send(req).await?; Ok(()) } ```