From ef44fc9497777d18ca0debba19c6f486dddfab1a Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Sun, 24 Sep 2017 20:13:38 -0700 Subject: [PATCH] Move handler definitions to top of file. --- lib/src/handler.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/src/handler.rs b/lib/src/handler.rs index dd0515ab..81cf0e08 100644 --- a/lib/src/handler.rs +++ b/lib/src/handler.rs @@ -10,6 +10,12 @@ use outcome; /// Type alias for the `Outcome` of a `Handler`. pub type Outcome<'r> = outcome::Outcome, Status, Data>; +/// The type of a request handler. +pub type Handler = for<'r> fn(&'r Request, Data) -> Outcome<'r>; + +/// The type of an error handler. +pub type ErrorHandler = for<'r> fn(Error, &'r Request) -> response::Result<'r>; + impl<'r> Outcome<'r> { /// Return the `Outcome` of response to `req` from `responder`. /// @@ -78,9 +84,3 @@ impl<'r> Outcome<'r> { outcome::Outcome::Forward(data) } } - -/// The type of a request handler. -pub type Handler = for<'r> fn(&'r Request, Data) -> Outcome<'r>; - -/// The type of an error handler. -pub type ErrorHandler = for<'r> fn(Error, &'r Request) -> response::Result<'r>;