fn serve(&self, path: &str, can_gzip: bool) -> Box<Future<Item = Response, Error = Error>> {
        match path {
            "/" => Box::new(
                self.render()
                    .and_then(move |body| html_response(&body, can_gzip)),
            ),
            _ => {
                if let Some(captures) = TIMELINE_PATH_RE.captures(path.as_bytes()) {
                    let number = from_utf8(captures.get(1).expect("PR number").as_bytes())
                        .expect("PR number")
                        .parse()
                        .expect("PR number");
                    Box::new(
                        self.render_timeline(number)
                            .and_then(move |body| html_response(&body, can_gzip)),
                    )
                } else {
                    Box::new(result(self.serve_sync(path, can_gzip)))
                }
            }
        }
    }
/// Serves a response from the URL.
Serves a response from the URL.
Serves a response from the URL .
fn serve(&self, path: &str, can_gzip: bool) -> Box<Future<Item = Response, Error = Error>> {
        match path {
            "/" => Box::new(
                self.render()
                    .and_then(move |body| html_response(&body, can_gzip)),
            ),
            _ => {
                if let Some(captures) = TIMELINE_PATH_RE.captures(path.as_bytes()) {
                    let number = from_utf8(captures.get(1).expect("PR number").as_bytes())
                        .expect("PR number")
                        .parse()
                        .expect("PR number");
                    Box::new(
                        self.render_timeline(number)
                            .and_then(move |body| html_response(&body, can_gzip)),
                    )
                } else {
                    Box::new(result(self.serve_sync(path, can_gzip)))
                }
            }
        }
    }
fn serve ( & self , path : & str , can_gzip : bool ) -> Box < Future < Item = Response , Error = Error > > { match path { " " => Box :: new ( self . render ( ) . and_then ( move | body | html_response ( & body , can_gzip ) ) , ) , _ => { if let Some ( captures ) = TIMELINE_PATH_RE . captures ( path . as_bytes ( ) ) { let number = from_utf8 ( captures . get ( 1 ) . expect ( " " ) . as_bytes ( ) ) . expect ( " " ) . parse ( ) . expect ( " " ) ; Box :: new ( self . render_timeline ( number ) . and_then ( move | body | html_response ( & body , can_gzip ) ) , ) } else { Box :: new ( result ( self . serve_sync ( path , can_gzip ) ) ) } } } }
Serves a response from the URL.
Serves a response from the URL .
&self
path
&str
can_gzip
bool
&self
path
&str
can_gzip
bool