Registry / utility / ratelimit-meter

ratelimit-meter

JSON →
library5.0.0rscratesunverified

A leaky-bucket-as-a-meter rate-limiting implementation in Rust.

# Cargo.toml [dependencies] ratelimit_meter = "5.0.0"
INSTALL
IMPORT
SIG · RATELIMIT-METER
R
ratelimit-meter
utilityrustv5.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LeakyBucket
use ratelimit_meter::LeakyBucket;

Checks if a request is allowed under a rate limit.

use ratelimit_meter::LeakyBucket; use std::time::Instant; fn main() { let mut bucket = LeakyBucket::new(10, 1); // 10 requests per second let now = Instant::now(); if bucket.check(now).is_ok() { println!("Request allowed"); } else { println!("Rate limited"); } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
5.0.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
ratelimit-meter — cargo add ratelimit-meter · libregistry