Skip to content

Commit 31f98b6

Browse files
committed
feat(util): add BodyExt::into_stream
1 parent 46c54fb commit 31f98b6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

http-body-util/src/lib.rs

+8
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@ pub trait BodyExt: http_body::Body {
128128
{
129129
combinators::WithTrailers::new(self, trailers)
130130
}
131+
132+
/// Turn this body into [`BodyStream`].
133+
fn into_stream(self) -> BodyStream<Self>
134+
where
135+
Self: Sized,
136+
{
137+
BodyStream::new(self)
138+
}
131139
}
132140

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

0 commit comments

Comments
 (0)