pub fn emit(&self, event: T, payload: U) {
        if let Some(handlers) = self.handlers.get(&event) {
            for handler in handlers {
                handler(&payload);
            }
        }
    }
/// Invokes all listeners of `event`, passing a reference to `payload` as an
/// argument to each of them.
Invokes all listeners of `event`, passing a reference to `payload` as an
argument to each of them.
Invokes all listeners of ` event ` passing a reference to ` payload ` as an argument to each of them .
pub fn emit(&self, event: T, payload: U) {
        if let Some(handlers) = self.handlers.get(&event) {
            for handler in handlers {
                handler(&payload);
            }
        }
    }
pub fn emit ( & self , event : T , payload : U ) { if let Some ( handlers ) = self . handlers . get ( & event ) { for handler in handlers { handler ( & payload ) ; } } }
Invokes all listeners of `event`, passing a reference to `payload` as an
argument to each of them.
Invokes all listeners of ` event ` passing a reference to ` payload ` as an argument to each of them .
&self
event
T
payload
U
&self
event
T
payload
U