From 86feb096fb895eb12c52b8555016168336d8aa8d Mon Sep 17 00:00:00 2001 From: tottoto Date: Sat, 30 Mar 2024 19:53:11 +0900 Subject: [PATCH] feat(util): add BodyExt::into_stream --- http-body-util/src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/http-body-util/src/lib.rs b/http-body-util/src/lib.rs index dee852c..c323c93 100644 --- a/http-body-util/src/lib.rs +++ b/http-body-util/src/lib.rs @@ -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 + where + Self: Sized, + { + BodyStream::new(self) + } + /// Turn this body into [`BodyDataStream`]. fn into_data_stream(self) -> BodyDataStream where