pub fn on<F>(&mut self, event: T, handler: F)
    where
        F: Fn(&U) + 'static,
    {
        let event_handlers =
            self.handlers.entry(event).or_insert_with(|| vec![]);
        event_handlers.push(Box::new(handler));
    }
/// Registers function `handler` as a listener for `event`.  There may be
/// multiple listeners for a single event.
Registers function `handler` as a listener for `event`.  There may be
multiple listeners for a single event.
Registers function ` handler ` as a listener for ` event ` . There may be multiple listeners for a single event .
pub fn on<F>(&mut self, event: T, handler: F)
    where
        F: Fn(&U) + 'static,
    {
        let event_handlers =
            self.handlers.entry(event).or_insert_with(|| vec![]);
        event_handlers.push(Box::new(handler));
    }
pub fn on < F > ( & mut self , event : T , handler : F ) where F : Fn ( & U ) + ' static , { let event_handlers = self . handlers . entry ( event ) . or_insert_with ( | | vec ! [ ] ) ; event_handlers . push ( Box :: new ( handler ) ) ; }
Registers function `handler` as a listener for `event`.
Registers function ` handler ` as a listener for ` event ` .
&mut self
event
T
handler
F
&mut self
event
T
handler
F