diff options
Diffstat (limited to 'src/handler.rs')
| -rw-r--r-- | src/handler.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/handler.rs b/src/handler.rs index f22e3b3..b283cdf 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -30,8 +30,14 @@ pub trait RouteResponse: impl<T> RouteResponse for T where T: FnMut(RouteContext<'_>) -> Response + Send + Sync {} -pub type ErrorResponse = - Box<dyn FnMut(returnable::ErrorContext<'_>) -> Response + Send + Sync>; +pub trait ErrorResponse: + FnMut(returnable::ErrorContext<'_>) -> Response + Send + Sync +{ +} + +impl<T> ErrorResponse for T where T: FnMut(returnable::ErrorContext<'_>) -> Response + Send + Sync +{} + pub type Callback = Box<dyn FnMut(CallbackContext<'_>) + Send + Sync>; pub type CleanupCallback = Box<dyn FnMut(CallbackContext<'_>, &mut Response) + Send + Sync>; |