Trait hey_listen::sync::ParallelListener
source · pub trait ParallelListener<T>where
T: PartialEq + Eq + Hash + Clone + Send + Sync + 'static,{
fn on_event(&mut self, event: &T) -> Option<ParallelDispatcherRequest>;
}
Expand description
Every event-receiver needs to implement this trait
in order to receive dispatched events.
T
being the type you use for events, e.g. an Enum
.
Required Methods§
sourcefn on_event(&mut self, event: &T) -> Option<ParallelDispatcherRequest>
fn on_event(&mut self, event: &T) -> Option<ParallelDispatcherRequest>
This function will be called once a listened
event-type T
has been dispatched.