aboutsummaryrefslogtreecommitdiff
path: root/src/handler/hooks/pre_route.rs
blob: 9b1eb7f834741130a503619384a8ad4bc09f79cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
use crate::context::HookContext;

#[allow(clippy::module_name_repetitions)]
pub trait PreRouteHook: Send + Sync {
  fn call(&mut self, context: HookContext);
}

impl<T> PreRouteHook for T
where T: FnMut(HookContext) + Send + Sync
{
  fn call(&mut self, context: HookContext) { (*self)(context) }
}