Skip to content

Commit

Permalink
feat(util): add BodyExt::into_stream
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto committed Jun 11, 2024
1 parent 482c349 commit 9c57e54
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions http-body-util/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ pub trait BodyExt: http_body::Body {
combinators::WithTrailers::new(self, trailers)
}

/// Turn this body into [`BodyStream`].
fn into_stream(self) -> BodyStream<Self>
where
Self: Sized,
{
BodyStream::new(self)
}

/// Turn this body into [`BodyDataStream`].
fn into_data_stream(self) -> BodyDataStream<Self>
where
Expand Down

0 comments on commit 9c57e54

Please sign in to comment.