From c6e8cd47dab746291ecdb0af920452dcf36acee9 Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Tue, 15 Mar 2016 00:47:03 -0700 Subject: [PATCH] Notes on a perhaps better Body. --- lib/src/response.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/src/response.rs b/lib/src/response.rs index 0cd1da46..c74eddcd 100644 --- a/lib/src/response.rs +++ b/lib/src/response.rs @@ -2,6 +2,10 @@ pub use hyper::status::StatusCode; pub use hyper::header::{self, Headers}; use std::io::Read; +// Consider simply having Body be a trait, `RocketBody`, with one function that +// takes in a prepped up HypResponse and acts on it. Then, `Response` changes +// to be a Response { body: T } and the Rocket HypHandler +// simply sets up the status codes, headers, and calls body.fn(res). pub enum Body<'a> { Bytes(&'a [u8]), Str(&'a str),