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

pub trait Module {
  /// Called right after the module is attached.
  fn on_attach(&mut self, _: &mut crate::router::Router) {}

  /// Called before a route is mounted.
  fn on_pre_route(&mut self, _: &HookContext) {}

  /// Called after a route is mounted.
  fn on_post_route(&mut self, _: &HookContext) {}
}