Given the following snippet, is it possible to make a similar logic using the newer Tokio-based Hyper?
struct MyRequest { ... }
impl MyRequest {
pub fn write(&mut self, writer: &mut Write) -> Result<usize> {
... write large piece of data (file) into writer ...
}
}
let mut http_req_fresh = Request::new(Method::Post, url)?;
let mut http_req_stream = http_req_fresh.start()?;
myrequest.write(&mut BufWriter::new(&mut http_req_stream))?;