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)
    }
}