diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-04-01 15:48:41 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-04-01 15:48:41 +0800 |
| commit | 3de10ca22cca06c4d9069984d0e66e370a331dde (patch) | |
| tree | 7e8a9b035c360c016cde848b3442d3e1d5dcac5e /mingling_core/src/program/setup | |
| parent | f3d6f76dfd07c35dabc11aa86d86c3671cd283c5 (diff) | |
Replace typeid-based dispatch with enum-based dispatch
- Add `Groupped` trait and `member_id` to `AnyOutput`
- Add generic parameter `G` to `Dispatcher`, `Chain`, `Program` etc
- Remove `hint` module and its marker types
- Update macros to support explicit group specification
- Add `gen_program` macro for generating enum-based programs
- Add `GroupProcess` marker type for type-level grouping
Diffstat (limited to 'mingling_core/src/program/setup')
| -rw-r--r-- | mingling_core/src/program/setup/basic.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mingling_core/src/program/setup/basic.rs b/mingling_core/src/program/setup/basic.rs index 43c14b9..8316a33 100644 --- a/mingling_core/src/program/setup/basic.rs +++ b/mingling_core/src/program/setup/basic.rs @@ -1,3 +1,5 @@ +use std::fmt::Display; + use crate::{ ProgramCollect, program::{Program, setup::ProgramSetup}, @@ -10,11 +12,12 @@ use crate::{ /// - Collects `--confirm` flag to skip user confirmation pub struct BasicProgramSetup; -impl<C> ProgramSetup<C> for BasicProgramSetup +impl<C, G> ProgramSetup<C, G> for BasicProgramSetup where C: ProgramCollect, + G: Display, { - fn setup(&mut self, program: &mut Program<C>) { + fn setup(&mut self, program: &mut Program<C, G>) { program.global_flag(["--quiet", "-q"], |p| { p.stdout_setting.render_output = false; p.stdout_setting.error_output = false; |
