2016-12-15 08:47:31 +00:00
|
|
|
use response::{Response, Responder};
|
|
|
|
use http::Status;
|
2016-10-25 11:03:50 +00:00
|
|
|
|
2016-11-02 17:48:43 +00:00
|
|
|
/// A failing response; simply forwards to the catcher for the given
|
2016-12-15 08:47:31 +00:00
|
|
|
/// `Status`.
|
2016-10-25 11:03:50 +00:00
|
|
|
#[derive(Debug)]
|
2016-12-15 08:47:31 +00:00
|
|
|
pub struct Failure(pub Status);
|
2016-10-25 11:03:50 +00:00
|
|
|
|
2016-12-15 08:47:31 +00:00
|
|
|
impl<'r> Responder<'r> for Failure {
|
|
|
|
fn respond(self) -> Result<Response<'r>, Status> {
|
|
|
|
Err(self.0)
|
2016-10-25 11:03:50 +00:00
|
|
|
}
|
|
|
|
}
|