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 Apr 1, 2024
1 parent 46c54fb commit 31f98b6
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 @@ -128,6 +128,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)
}
}

impl<T: ?Sized> BodyExt for T where T: http_body::Body {}

0 comments on commit 31f98b6

Please sign in to comment.