2 releases

0.1.1 Jul 11, 2024
0.1.0 May 9, 2023

#79 in No standard library

Download history 202/week @ 2024-08-26 472/week @ 2024-09-02 429/week @ 2024-09-09 347/week @ 2024-09-16 469/week @ 2024-09-23 147/week @ 2024-09-30 728/week @ 2024-10-07 1221/week @ 2024-10-14 729/week @ 2024-10-21 527/week @ 2024-10-28 76/week @ 2024-11-04 344/week @ 2024-11-11 597/week @ 2024-11-18 383/week @ 2024-11-25 511/week @ 2024-12-02 406/week @ 2024-12-09

1,920 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