tower_http_util/body/
mod.rs

1//! Types and utilities for working with `Body`.
2
3mod into_buf_stream;
4
5pub use self::into_buf_stream::IntoBufStream;
6
7use http_body::Body;
8
9/// An extension trait for `Body` providing additional adapters.
10pub trait BodyExt: Body {
11    /// Wrap the `Body` so that it implements tokio_buf::BufStream directly.
12    fn into_buf_stream(self) -> IntoBufStream<Self>
13    where
14        Self: Sized,
15    {
16        IntoBufStream::new(self)
17    }
18}
19
20impl<T: Body> BodyExt for T {}