2 releases

0.1.1 Jul 11, 2024
0.1.0 May 9, 2023

#73 in No standard library

Download history 589/week @ 2024-07-30 140/week @ 2024-08-06 231/week @ 2024-08-13 233/week @ 2024-08-20 213/week @ 2024-08-27 417/week @ 2024-09-03 449/week @ 2024-09-10 488/week @ 2024-09-17 359/week @ 2024-09-24 137/week @ 2024-10-01 806/week @ 2024-10-08 1270/week @ 2024-10-15 716/week @ 2024-10-22 363/week @ 2024-10-29 130/week @ 2024-11-05 338/week @ 2024-11-12

1,727 downloads per month

GPL-3.0-or-later OR Apache-2…

4KB

handler_table

Crates.io

A lock-free table of event handlers.

Examples

use handler_table::HandlerTable;

static TABLE: HandlerTable<8> = HandlerTable::new();

TABLE.register_handler(0, || {
   println!("Hello, event 0!");
});
TABLE.register_handler(1, || {
   println!("Hello, event 1!");
});

assert!(TABLE.handle(0)); // print "Hello, event 0!"
assert!(!TABLE.handle(2)); // unregistered

No runtime deps