aboutsummaryrefslogtreecommitdiff
path: root/src/handler/hooks/post_route.rs
blob: 0a6e6b7f3472ac5022fefb63825948317c72cfd4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::{context::HookContext, response::Response};

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

impl<T> PostRouteHook for T
where T: Fn(&HookContext, &mut Response) + Send + Sync
{
  fn call(&self, context: &HookContext, response: &mut Response) {
    (*self)(context, response);
  }
}