rocket 0.2.9

Web framework for nightly with a focus on ease-of-use, expressibility, and speed.
1
2
3
4
5
6
7
8
9
10
11
12
13
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<'r> Responder<'r> for Failure {
    fn respond(self) -> Result<Response<'r>, Status> {
        Err(self.0)
    }
}