pub struct BodyLimitLayer { /* private fields */ }Expand description
Limit the size of the request and/or response bodies.
As this layer operates on the transport layer (Stream),
it only is used to add the BodyLimit value to input Extensions,
such that the L7 http service can apply the limit when found in those Extensions.
Implementations§
Source§impl BodyLimitLayer
impl BodyLimitLayer
Sourcepub fn request_only(limit: usize) -> Self
pub fn request_only(limit: usize) -> Self
Create a new BodyLimitLayer, with the given limit to be applied to the request only.
See BodyLimitLayer for more information.
Sourcepub fn response_only(limit: usize) -> Self
pub fn response_only(limit: usize) -> Self
Create a new BodyLimitLayer, with the given limit to be applied to the response only.
See BodyLimitLayer for more information.
Sourcepub fn symmetric(limit: usize) -> Self
pub fn symmetric(limit: usize) -> Self
Create a new BodyLimitLayer, with the given limit to be applied to both the request and response bodies.
See BodyLimitLayer for more information.
Sourcepub fn asymmetric(request: usize, response: usize) -> Self
pub fn asymmetric(request: usize, response: usize) -> Self
Create a new BodyLimitLayer, with the given limits
respectively to be applied to the request and response bodies.
See BodyLimitLayer for more information.
Trait Implementations§
Source§impl Clone for BodyLimitLayer
impl Clone for BodyLimitLayer
Source§fn clone(&self) -> BodyLimitLayer
fn clone(&self) -> BodyLimitLayer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BodyLimitLayer
impl Debug for BodyLimitLayer
Source§impl<S> Layer<S> for BodyLimitLayer
impl<S> Layer<S> for BodyLimitLayer
Source§type Service = BodyLimitService<S>
type Service = BodyLimitService<S>
Source§fn layer(&self, inner: S) -> Self::Service
fn layer(&self, inner: S) -> Self::Service
Source§fn into_layer(self, inner: S) -> Self::Service
fn into_layer(self, inner: S) -> Self::Service
layer but consuming self after the service was created. Read moreAuto Trait Implementations§
impl Freeze for BodyLimitLayer
impl RefUnwindSafe for BodyLimitLayer
impl Send for BodyLimitLayer
impl Sync for BodyLimitLayer
impl Unpin for BodyLimitLayer
impl UnsafeUnpin for BodyLimitLayer
impl UnwindSafe for BodyLimitLayer
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more