pub struct RateLimitMiddleware { /* private fields */ }Implementations§
Source§impl RateLimitMiddleware
impl RateLimitMiddleware
pub fn new(requests_per_second: f64, burst_size: u32) -> RateLimitMiddleware
pub fn new_with_max_ips( requests_per_second: f64, burst_size: u32, max_tracked_ips: usize, ) -> RateLimitMiddleware
pub fn from_config(cfg: &RateLimitSection) -> RateLimitMiddleware
Trait Implementations§
Source§impl IMiddleware for RateLimitMiddleware
impl IMiddleware for RateLimitMiddleware
Source§fn invoke<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut dyn IHttpContext,
) -> Pin<Box<dyn Future<Output = Result<ControlFlow<()>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
RateLimitMiddleware: 'async_trait,
fn invoke<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 mut dyn IHttpContext,
) -> Pin<Box<dyn Future<Output = Result<ControlFlow<()>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
RateLimitMiddleware: 'async_trait,
Process an HTTP request (before hook). Read more
Auto Trait Implementations§
impl !Freeze for RateLimitMiddleware
impl !RefUnwindSafe for RateLimitMiddleware
impl !UnwindSafe for RateLimitMiddleware
impl Send for RateLimitMiddleware
impl Sync for RateLimitMiddleware
impl Unpin for RateLimitMiddleware
impl UnsafeUnpin for RateLimitMiddleware
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more