diff options
Diffstat (limited to 'src/handler/hooks/pre_route.rs')
| -rw-r--r-- | src/handler/hooks/pre_route.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/handler/hooks/pre_route.rs b/src/handler/hooks/pre_route.rs index af5ed9d..ff6162f 100644 --- a/src/handler/hooks/pre_route.rs +++ b/src/handler/hooks/pre_route.rs @@ -19,6 +19,12 @@ use crate::context::HookContext; #[allow(clippy::module_name_repetitions)] -pub trait PreRouteHook: FnMut(HookContext) + Send + Sync {} +pub trait PreRouteHook: Send + Sync { + fn call(&mut self, context: HookContext); +} -impl<T> PreRouteHook for T where T: FnMut(HookContext) + Send + Sync {} +impl<T> PreRouteHook for T +where T: FnMut(HookContext) + Send + Sync +{ + fn call(&mut self, context: HookContext) { (*self)(context) } +} |