Migrate the rest of the code.

This commit is contained in:
Paul
2021-08-04 10:11:21 +01:00
committed by Paul Makles
parent 9fec4e48c0
commit 382972ea22
12 changed files with 49 additions and 216 deletions

View File

@@ -1,9 +1,13 @@
use rocket_governor::{Method, Quota, RocketGovernable, RocketGovernor};
use std::time::Duration;
use rocket_governor::{Method, Quota, RocketGovernable};
pub struct RateLimitGuard;
impl<'r> RocketGovernable<'r> for RateLimitGuard {
fn quota(_method: Method, _route_name: &str) -> Quota {
dbg!(_method, _route_name);
Quota::per_second(Self::nonzero(1u32))
.allow_burst(Self::nonzero(10u32))
}
}