hyper-async-io 0.1.0

A simple crate that provides an interface to AsyncRead and AsyncWrite for Hyper's Body
Documentation
pub mod tokio;

pub struct BodyWriter {
    sender: hyper::body::Sender,
}

impl BodyWriter {
    pub fn channel() -> (Self, hyper::Body) {
        let (sender, body) = hyper::body::Body::channel();
        (Self { sender }, body)
    }
}

pub struct BodyReader {
    body: hyper::body::Body,
}

impl BodyReader {
    pub fn new(body: hyper::Body) -> Self {
        Self { body }
    }
}

impl From<hyper::Body> for BodyReader {
    fn from(body: hyper::Body) -> Self {
        Self::new(body)
    }
}