test
This commit is contained in:
+17
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user