Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions http-body-util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self>
where
Self: Sized,
{
Limited::new(self, limit)
}

/// Turn this body into [`Collected`] body which will collect all the DATA frames
/// and trailers.
Expand Down