aboutsummaryrefslogtreecommitdiff
path: root/src/module
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-04-14 09:05:03 +0000
committerFuwn <[email protected]>2026-04-14 09:05:03 +0000
commit92180ab10c5cd1394b3c288e4d730aa37c527629 (patch)
tree17c1495e9724662206ef8c42091f972a0f2bc243 /src/module
parentperf(router)!: Remove AsyncMutex from route and error handlers (diff)
downloadarchived-windmark-92180ab10c5cd1394b3c288e4d730aa37c527629.tar.xz
archived-windmark-92180ab10c5cd1394b3c288e4d730aa37c527629.zip
perf(router)!: Pass HookContext by reference to modules and hooks
Diffstat (limited to 'src/module')
-rw-r--r--src/module/asynchronous.rs4
-rw-r--r--src/module/sync.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/module/asynchronous.rs b/src/module/asynchronous.rs
index 8822ea4..1cd5673 100644
--- a/src/module/asynchronous.rs
+++ b/src/module/asynchronous.rs
@@ -6,8 +6,8 @@ pub trait AsyncModule: Send + Sync {
async fn on_attach(&mut self, _: &mut crate::router::Router) {}
/// Called before a route is mounted.
- async fn on_pre_route(&mut self, _: HookContext) {}
+ async fn on_pre_route(&mut self, _: &HookContext) {}
/// Called after a route is mounted.
- async fn on_post_route(&mut self, _: HookContext) {}
+ async fn on_post_route(&mut self, _: &HookContext) {}
}
diff --git a/src/module/sync.rs b/src/module/sync.rs
index a38b541..d32d81f 100644
--- a/src/module/sync.rs
+++ b/src/module/sync.rs
@@ -5,8 +5,8 @@ pub trait Module {
fn on_attach(&mut self, _: &mut crate::router::Router) {}
/// Called before a route is mounted.
- fn on_pre_route(&mut self, _: HookContext) {}
+ fn on_pre_route(&mut self, _: &HookContext) {}
/// Called after a route is mounted.
- fn on_post_route(&mut self, _: HookContext) {}
+ fn on_post_route(&mut self, _: &HookContext) {}
}