title: How do I send a file included with include_bytes! as an Iron response?
body: <p>I'm trying to send a file that I included in the binary with <code>include_bytes!</code> in an Iron application. I want to end up with a single file for my application and it only needs very few HTML, CSS and JS files. Here's a small test setup that I'm fiddling with:</p>
  
  <pre><code>extern crate iron;
  
  use iron::prelude::*;
  use iron::status;
  use iron::mime::Mime;
  
  fn main() {
      let index_html = include_bytes!("static/index.html");
  
      println!("Hello, world!");
      Iron::new(| _: &amp;mut Request| {
          let content_type = "text/html".parse::&lt;Mime&gt;().unwrap();
          Ok(Response::with((content_type, status::Ok, index_html)))
      }).http("localhost:8001").unwrap();
  }
  </code></pre>
  
  <p>Of course, this doesn't work since <code>index_html</code> is of type <code>&amp;[u8; 78]</code></p>
  
  <pre><code>src/main.rs:16:12: 16:26 error: the trait `modifier::Modifier&lt;iron::response::Response&gt;` is not implemented for the type `&amp;[u8; 78]` [E0277]
  src/main.rs:16         Ok(Response::with((content_type, status::Ok, index_html)))
  </code></pre>
  
  <p>Since I'm quite new to Rust and Iron, I don't have an idea how to approach this. I tried to learn something from the Iron docs but I think my Rust knowledge is not sufficient to really understand them, especially what this <code>modifier::Modifier</code> trait is supposed to be.</p>
  
  <p>How can I achieve this? Can I covert the type of my static resource into something that Iron will accept or do I need to implement this <code>Modifier</code> trait somehow?</p>