summaryrefslogtreecommitdiff
path: root/mingling/src/program/setup.rs
diff options
context:
space:
mode:
Diffstat (limited to 'mingling/src/program/setup.rs')
-rw-r--r--mingling/src/program/setup.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/mingling/src/program/setup.rs b/mingling/src/program/setup.rs
new file mode 100644
index 0000000..fdf7b04
--- /dev/null
+++ b/mingling/src/program/setup.rs
@@ -0,0 +1,15 @@
+use crate::program::Program;
+
+mod basic;
+pub use basic::*;
+
+pub trait ProgramSetup {
+ fn setup(program: &mut Program);
+}
+
+impl Program {
+ /// Load and execute init logic
+ pub fn with_setup<S: ProgramSetup + 'static>(&mut self, _setup: S) {
+ S::setup(self);
+ }
+}