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 Mar 30, 2024
1 parent b5c769d commit 253a59a
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 253a59a

Please sign in to comment.