Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#[deriving(Decodable, Encodable)]
struct DoneCompiled {
compileError: String,
stdout: String,
stderr: String,
impl<'a, T: Encodable<Encoder<'a>, std::io::IoError>> Bodyable for T {
fn set_body(self, res: &mut Response) {
let s = json::encode(&self);
let m = MemReader::new(s.into_bytes());
res.body = Some(box m as Box<Reader+Send>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment