test
This commit is contained in:
@@ -0,0 +1,4 @@
|
|||||||
|
fn main() {
|
||||||
|
let mut engine = osmium::init();
|
||||||
|
engine.thread("Main.event", move || {});
|
||||||
|
}
|
||||||
+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