ratelimit_meter 5.0.0

A leaky-bucket-as-a-meter rate-limiting implementation in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![doc(hidden)]
//! A module for code shared between integration tests & benchmarks in this crate.

pub mod algorithms;
pub mod variants;

use crate::lib::*;

use crate::clock;
use crate::clock::Clock;

/// Returns a "current" moment that's suitable for tests.
pub fn current_moment() -> <clock::DefaultClock as clock::Clock>::Instant {
    let c = clock::DefaultClock::default();
    c.now()
}