| Crates.io | mono_event |
| lib.rs | mono_event |
| version | 0.6.0 |
| created_at | 2024-05-15 09:45:44.833233+00 |
| updated_at | 2024-05-22 07:11:19.291926+00 |
| description | super fast event system |
| homepage | |
| repository | https://github.com/Bruce0203/mono_event |
| max_upload_size | |
| id | 1240826 |
| size | 3,775 |
This library is nightly-only as it relies on specialization
#![feature(min_specialization)]
use mono_event::{event, highest_priority, listen, low_priority};
#[test]
fn example() {
SayHi.dispatch().unwrap();
}
#[event]
pub struct SayHi;
#[highest_priority]
#[listen(SayHi)]
fn print_hi(event: &mut SayHi) {
println!("say hi");
}
#[low_priority]
#[listen(SayHi)]
fn print_hmm(event: &mut SayHi) {
println!("say hmm..");
}
output:
say hmm..
say hi