This commit is contained in:
2025-11-25 22:58:05 +01:00
parent dcedc59190
commit fde5f11568
2 changed files with 21 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
use std::collections::HashMap;
pub fn init() -> Engine {
Engine {
threads: HashMap::new(),
}
}
pub struct Engine {
threads: HashMap<String, Box<dyn FnMut() + Send + Sync>>,
}
impl Engine {
pub fn thread<F: FnMut() + Send + Sync + 'static>(&mut self, label: &str, f: F) {
self.threads.insert(label.to_string(), Box::new(f));
}
}