aboutsummaryrefslogtreecommitdiff
path: root/mingling_core/src/program/setup.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-05-09 16:42:50 +0800
committer魏曹先生 <1992414357@qq.com>2026-05-09 17:13:35 +0800
commit10bc4ca7a4b3f14cfb57bf72a6da8aaa1490acf3 (patch)
tree8b985dad38cfcd4c88af962b3e163131b258a381 /mingling_core/src/program/setup.rs
parent89b5132b8c17b6eba45b1bd49aa18b0c02016387 (diff)
Add lifecycle hooks to program execution
Diffstat (limited to 'mingling_core/src/program/setup.rs')
-rw-r--r--mingling_core/src/program/setup.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/mingling_core/src/program/setup.rs b/mingling_core/src/program/setup.rs
index 86228b9..28aa49b 100644
--- a/mingling_core/src/program/setup.rs
+++ b/mingling_core/src/program/setup.rs
@@ -5,19 +5,20 @@ pub use basic::*;
#[cfg(feature = "general_renderer")]
mod general_renderer;
+
#[cfg(feature = "general_renderer")]
pub use general_renderer::*;
pub trait ProgramSetup<C>
where
- C: ProgramCollect,
+ C: ProgramCollect<Enum = C>,
{
fn setup(&mut self, program: &mut Program<C>);
}
impl<C> Program<C>
where
- C: ProgramCollect,
+ C: ProgramCollect<Enum = C>,
{
/// Load and execute init logic
pub fn with_setup<S: ProgramSetup<C> + 'static>(&mut self, mut setup: S) -> S {