Start moving to Rocket 0.5.0

This commit is contained in:
Paul
2021-08-03 14:40:07 +01:00
committed by Paul Makles
parent 33262cc703
commit 9fec4e48c0
62 changed files with 821 additions and 421 deletions

View File

@@ -1,2 +1,3 @@
pub mod result;
pub mod variables;
pub mod ratelimit;

9
src/util/ratelimit.rs Normal file
View File

@@ -0,0 +1,9 @@
use rocket_governor::{Method, Quota, RocketGovernable, RocketGovernor};
pub struct RateLimitGuard;
impl<'r> RocketGovernable<'r> for RateLimitGuard {
fn quota(_method: Method, _route_name: &str) -> Quota {
Quota::per_second(Self::nonzero(1u32))
}
}