aboutsummaryrefslogtreecommitdiff
path: root/CHANGELOG.md
diff options
context:
space:
mode:
authorWeicao-CatilGrass <1992414357@qq.com>2026-05-13 07:28:02 +0800
committerWeicao-CatilGrass <1992414357@qq.com>2026-05-13 07:28:02 +0800
commit95c6b979ca399671eed8bf9c72f53cfe5d46f431 (patch)
tree8225b39bee4ad3b7ebc8a36ab978d1329f667eb8 /CHANGELOG.md
parentfef888b75b2544765aa06808c14490a2af827313 (diff)
Migrate exit code control to resource-based system
Diffstat (limited to 'CHANGELOG.md')
-rw-r--r--CHANGELOG.md13
1 files changed, 11 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 499161e..96db9ee 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -46,13 +46,22 @@ if mingling::feature::MINGLING_ASYNC {
}
```
-5. **\[core\]** Added `with_hook` and `with_hook_anonymous` functions to embed callback events into the program lifecycle
+5. **\[core\]** Added `with_hook` functions to embed callback events into the program lifecycle
6. **\[core\]** Added `user_context.run_hook` configuration item to control whether the program runs hooks
7. **\[core\]** Added `exec_and_exit`, which will return an `i32` exit code after the program ends
-8. **\[core\]** Added `ExitCodeSetup`, now you can use `mingling::update_exit_code(i32)` to control the exit code
+8. **\[core\]** Added `ExitCodeSetup`, you can control the program's exit code by modifying the `mingling::res::ExitCode` resource
+
+```rust
+#[chain]
+fn your_chain(_prev: Prev) -> NextProcess {
+ // Use `modify_res` to modify the value of `ExitCode`
+ this::<ThisProgram>().modify_res(|r: &mut ExitCode| r.exit_code = 1);
+ // ...
+}
+```
9. **\[core\]** `RenderResult` now carries new data `exit_code`