Created
January 2, 2016 23:54
-
-
Save tailhook/92f443a9a5d41bf65ab7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn request_start(self, head: Head, resp: &mut Response, scope: &mut Scope<C>) | |
| -> Option<Self> | |
| { | |
| res.status(hyper::status::StatusCode::Ok); | |
| res.add_header(TransferEncoding(vec![Encoding::Chunked]).unwrap(); | |
| res.done_headers().unwrap(); | |
| self | |
| } | |
| fn request_chunk(self, chunk: &[u8], resp: &mut Response, scope: &mut Scope<C>) | |
| -> Option<Self> | |
| { | |
| res.write_body( | |
| format!("Received chunk of {} bytes\n", chunk.len())); | |
| self | |
| } | |
| fn request_end(self, _response: &mut Response, _scope: &mut Scope<C>) | |
| -> Option<Self> | |
| { | |
| res.done(); | |
| None | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
should
resp: &mut Responseberes: &mut Response?