forked from jmug/stoatchat
Start moving to Rocket 0.5.0
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
pub mod result;
|
||||
pub mod variables;
|
||||
pub mod ratelimit;
|
||||
|
||||
9
src/util/ratelimit.rs
Normal file
9
src/util/ratelimit.rs
Normal 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))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user