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