aboutsummaryrefslogtreecommitdiff
path: root/src/handler/hooks/pre_route.rs
blob: 322969ce6c87142def55c80df7b532d395b785ca (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(&self, context: &HookContext);
}

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