Crate rl_core

Source
Expand description

Simple, pure rate limiting.

const CONFIG: rl_core::Config = rl_core::Config::new(
	std::time::Duration::from_secs(1),
	3,
);
let mut tracker = rl_core::Tracker::full();
assert!(tracker.acquire(&CONFIG, 1).is_ok());
assert!(tracker.acquire(&CONFIG, 2).is_ok());
assert!(tracker.acquire(&CONFIG, 1).is_err());

Structs§

Enums§