hyper_async_io/
lib.rs

1pub mod tokio;
2
3pub struct BodyWriter {
4    sender: hyper::body::Sender,
5}
6
7impl BodyWriter {
8    pub fn channel() -> (Self, hyper::Body) {
9        let (sender, body) = hyper::body::Body::channel();
10        (Self { sender }, body)
11    }
12}
13
14pub struct BodyReader {
15    body: hyper::body::Body,
16}
17
18impl BodyReader {
19    pub fn new(body: hyper::Body) -> Self {
20        Self { body }
21    }
22}
23
24impl From<hyper::Body> for BodyReader {
25    fn from(body: hyper::Body) -> Self {
26        Self::new(body)
27    }
28}