aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/program/hook.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-07-21 03:58:44 +0800
committer魏曹先生 <1992414357@qq.com>2026-07-21 03:58:44 +0800
commita3b75b7eeae5e7a0c53b6167bafb75a85fa6d9ce (patch)
tree26219f710a5cac52b257f330bcfa29d3b6cae312 /mingling_core/src/program/hook.rs
parent57746fc1512400fde467d3ccac4589915341416c (diff)
feat(core): return `&mut Self` from builder methods
Enables method chaining for `with_resource`, `with_dispatcher`, `with_dispatchers`, `with_hook`, and `with_setup`
Diffstat (limited to 'mingling_core/src/program/hook.rs')
-rw-r--r--mingling_core/src/program/hook.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/mingling_core/src/program/hook.rs b/mingling_core/src/program/hook.rs
index db1691b..48f632f 100644
--- a/mingling_core/src/program/hook.rs
+++ b/mingling_core/src/program/hook.rs
@@ -144,8 +144,9 @@ where
{
/// Adds a typed hook to the program. The hook will be called at the appropriate
/// lifecycle events.
- pub fn with_hook(&mut self, hook: ProgramHook<C>) {
+ pub fn with_hook(&mut self, hook: ProgramHook<C>) -> &mut Self {
self.hooks.push(hook);
+ self
}
pub(crate) fn run_hook_on_begin(&self, info: HookBeginInfo) {