http_body_reader/
lib.rs

1#![cfg_attr(docsrs, feature(doc_auto_cfg, doc_cfg))]
2#![warn(missing_docs)]
3
4//! # Overview
5//!
6#![doc = include_utils::include_md!("README.md:description")]
7//!
8
9pub use body_reader::{BodyReader, BodyReaderError};
10
11mod body_reader;
12
13/// Extension trait for the [`http::Response`].
14pub trait ResponseExt<T>: Sized {
15    /// Consumes the response and returns a body reader wrapper.
16    fn body_reader(self) -> BodyReader<T>;
17}
18
19impl<T> ResponseExt<T> for http::Response<T> {
20    fn body_reader(self) -> BodyReader<T> {
21        BodyReader::from(self)
22    }
23}