2016-10-25 11:03:50 +00:00
|
|
|
use outcome::Outcome;
|
|
|
|
use response::{self, Responder};
|
|
|
|
use http::hyper::{FreshHyperResponse, StatusCode};
|
|
|
|
|
2016-11-02 17:48:43 +00:00
|
|
|
/// A failing response; simply forwards to the catcher for the given
|
|
|
|
/// `StatusCode`.
|
2016-10-25 11:03:50 +00:00
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct Failure(pub StatusCode);
|
|
|
|
|
|
|
|
impl Responder for Failure {
|
|
|
|
fn respond<'a>(&mut self, res: FreshHyperResponse<'a>) -> response::Outcome<'a> {
|
|
|
|
Outcome::Forward((self.0, res))
|
|
|
|
}
|
|
|
|
}
|