1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#![allow(dead_code)] #![allow(unused)] pub struct Event { kind: EventKind, } pub enum EventKind { Arrival, Change, Removal, } pub trait EventHandler { fn handle_event(&mut self, event: Event); } pub fn watch<T: EventHandler>(handler: T) { todo!() }