Crates.io | rust_event_listener |
lib.rs | rust_event_listener |
version | 0.1.0 |
source | src |
created_at | 2022-03-10 20:11:53.921056 |
updated_at | 2022-03-10 20:11:53.921056 |
description | NodeJS like Event Listener library for rust! |
homepage | |
repository | https://github.com/behemehal/rust_event_listener |
max_upload_size | |
id | 547815 |
size | 29,677 |
NodeJS like Event Listener library for rust!
//Create new emitter
let mut emitter = EventListener::new();
//Set max listeners
emitter.set_max_listeners(10);
//Add listener
emitter.on("test", Box::new(|name, d| {
println!("Emited: {} {:#?}", name, d);
}));
emitter.emit("test", 1);
You can find examples here