diff --git a/http-body-util/src/lib.rs b/http-body-util/src/lib.rs index dee852c..2ddc2bc 100644 --- a/http-body-util/src/lib.rs +++ b/http-body-util/src/lib.rs @@ -72,6 +72,14 @@ pub trait BodyExt: http_body::Body { { UnsyncBoxBody::new(self) } + + /// Turn this body into a [`Limited`] body with the given limit. + fn limited(self, limit: usize) -> Limited + where + Self: Sized, + { + Limited::new(self, limit) + } /// Turn this body into [`Collected`] body which will collect all the DATA frames /// and trailers.