diff --git a/http-body-util/src/lib.rs b/http-body-util/src/lib.rs index ae2c369..5b68cf1 100644 --- a/http-body-util/src/lib.rs +++ b/http-body-util/src/lib.rs @@ -100,6 +100,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. fn collect(self) -> combinators::Collect