Trait domafic::listener::Listener
[−]
[src]
pub trait Listener<Message> { fn event_type_handled(&self) -> &'static str; fn handle_event(&self, _: Event) -> Message; }
Listener
s listen to events and convert them into a message
Required Methods
fn event_type_handled(&self) -> &'static str
Type of event handled by this Listener
. Example: "click".
fn handle_event(&self, _: Event) -> Message
Handle a given event, producing a message
Implementors
impl<M, F: Fn(Event) -> M> Listener<M> for FnListener<M, F>