rocket 0.3.1

Web framework for nightly with a focus on ease-of-use, expressibility, and speed.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use request::Request;
use response::{Response, Responder};
use http::Status;

/// A failing response; simply forwards to the catcher for the given
/// `Status`.
#[derive(Debug)]
pub struct Failure(pub Status);

impl Responder<'static> for Failure {
    fn respond_to(self, _: &Request) -> Result<Response<'static>, Status> {
        Err(self.0)
    }
}