rl-core 1.18.0

Core logic for a token-bucket rate-limiter.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
pub trait Duration: Clone + std::fmt::Debug + Ord {
	fn mul(self, s: u32) -> Self;

	/// Divide
	///
	/// The right hand side is never zero.
	fn div(self, that: Self) -> u32;

	/// A value that is used to mock out math for disabled trackers.
	///
	/// Must not be zero or divisions by zero will occur.
	fn null() -> Self;

	fn zero() -> Self;
}