From 31f98b60f892f3e8fb6b517dace40320645e466d 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 b655e2a..1f7828f 100644 --- a/http-body-util/src/lib.rs +++ b/http-body-util/src/lib.rs @@ -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 + where + Self: Sized, + { + BodyStream::new(self) + } } impl BodyExt for T where T: http_body::Body {}