mono_event

Crates.iomono_event
lib.rsmono_event
version0.6.0
sourcesrc
created_at2024-05-15 09:45:44.833233
updated_at2024-05-22 07:11:19.291926
descriptionsuper fast event system
homepage
repositoryhttps://github.com/Bruce0203/mono_event
max_upload_size
id1240826
size3,775
(Bruce0203)

documentation

README

mono event

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
Commit count: 22

cargo fmt