pub struct BodyLimitMiddleware { /* private fields */ }Expand description
Body size limit middleware.
Rejects requests whose body exceeds the configured maximum size.
Implementations§
Source§impl BodyLimitMiddleware
impl BodyLimitMiddleware
pub fn new(config: BodyLimitConfig) -> BodyLimitMiddleware
Trait Implementations§
Source§impl Middleware for BodyLimitMiddleware
impl Middleware for BodyLimitMiddleware
Source§fn before_request<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthResponse>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BodyLimitMiddleware: 'async_trait,
fn before_request<'life0, 'life1, 'async_trait>(
&'life0 self,
req: &'life1 AuthRequest,
) -> Pin<Box<dyn Future<Output = Result<Option<AuthResponse>, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
BodyLimitMiddleware: 'async_trait,
Called before the request is dispatched to plugins. Read more
Source§fn after_request<'life0, 'life1, 'async_trait>(
&'life0 self,
_req: &'life1 AuthRequest,
response: AuthResponse,
) -> Pin<Box<dyn Future<Output = Result<AuthResponse, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn after_request<'life0, 'life1, 'async_trait>(
&'life0 self,
_req: &'life1 AuthRequest,
response: AuthResponse,
) -> Pin<Box<dyn Future<Output = Result<AuthResponse, AuthError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Called after a response has been produced. Read more
Auto Trait Implementations§
impl Freeze for BodyLimitMiddleware
impl RefUnwindSafe for BodyLimitMiddleware
impl Send for BodyLimitMiddleware
impl Sync for BodyLimitMiddleware
impl Unpin for BodyLimitMiddleware
impl UnwindSafe for BodyLimitMiddleware
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