diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-07-19 00:35:09 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-07-19 00:35:09 +0800 |
| commit | 501eb14dfca05813fa7a16f13f2efd9ba2b8c923 (patch) | |
| tree | 2c1c7a58c50a2ac07a7eb9e3d698c33442430aea /mingling_core | |
| parent | 5e460470f6ea2ce31a403b6e936ec2fe8f45312a (diff) | |
docs: add doc comments for Picker, AsPicker, and ProgramSetup traits
Diffstat (limited to 'mingling_core')
| -rw-r--r-- | mingling_core/src/program/setup.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mingling_core/src/program/setup.rs b/mingling_core/src/program/setup.rs index f248fb6..838c29a 100644 --- a/mingling_core/src/program/setup.rs +++ b/mingling_core/src/program/setup.rs @@ -1,9 +1,26 @@ use crate::{ProgramCollect, program::Program}; +/// Trait for defining initialization/setup logic for a `Program`. +/// +/// Implementors can define custom setup behavior that will be executed +/// when the program is initialized via [`Program::with_setup`]. +/// +/// # Type Parameters +/// +/// * `C` - The program collect type, which must implement [`ProgramCollect`] +/// and have `Enum = C` (i.e., it collects itself). pub trait ProgramSetup<C> where C: ProgramCollect<Enum = C>, { + /// Perform setup on the given program. + /// + /// This method consumes the setup instance (`self`) and is called once + /// during program initialization. + /// + /// # Arguments + /// + /// * `program` - A mutable reference to the [`Program`] being set up. fn setup(self, program: &mut Program<C>); } |
