2 releases

0.1.1 Jul 11, 2024
0.1.0 May 9, 2023

#82 in No standard library

Download history 210/week @ 2024-08-18 195/week @ 2024-08-25 414/week @ 2024-09-01 490/week @ 2024-09-08 351/week @ 2024-09-15 429/week @ 2024-09-22 165/week @ 2024-09-29 691/week @ 2024-10-06 1181/week @ 2024-10-13 788/week @ 2024-10-20 549/week @ 2024-10-27 91/week @ 2024-11-03 328/week @ 2024-11-10 561/week @ 2024-11-17 411/week @ 2024-11-24 559/week @ 2024-12-01

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