summaryrefslogtreecommitdiff
path: root/mingling/src/program/setup.rs
blob: fdf7b04b86c959f186d80a38c734389b06026edc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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);
    }
}