Struct RequestBodyLimitLayer
pub struct RequestBodyLimitLayer { /* private fields */ }Expand description
Layer that applies the RequestBodyLimit middleware that intercepts requests
with body lengths greater than the configured limit and converts them into
413 Payload Too Large responses.
See the module docs for an example.
Implementations§
§impl RequestBodyLimitLayer
impl RequestBodyLimitLayer
pub fn new(limit: usize) -> RequestBodyLimitLayer
pub fn new(limit: usize) -> RequestBodyLimitLayer
Create a new RequestBodyLimitLayer with the given body length limit.
Trait Implementations§
§impl Clone for RequestBodyLimitLayer
impl Clone for RequestBodyLimitLayer
§fn clone(&self) -> RequestBodyLimitLayer
fn clone(&self) -> RequestBodyLimitLayer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for RequestBodyLimitLayer
impl Debug for RequestBodyLimitLayer
§impl<S> Layer<S> for RequestBodyLimitLayer
impl<S> Layer<S> for RequestBodyLimitLayer
§fn layer(&self, inner: S) -> <RequestBodyLimitLayer as Layer<S>>::Service
fn layer(&self, inner: S) -> <RequestBodyLimitLayer as Layer<S>>::Service
Wrap the given service with the middleware, returning a new service
that has been decorated with the middleware.
impl Copy for RequestBodyLimitLayer
Auto Trait Implementations§
impl Freeze for RequestBodyLimitLayer
impl RefUnwindSafe for RequestBodyLimitLayer
impl Send for RequestBodyLimitLayer
impl Sync for RequestBodyLimitLayer
impl Unpin for RequestBodyLimitLayer
impl UnsafeUnpin for RequestBodyLimitLayer
impl UnwindSafe for RequestBodyLimitLayer
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