Trait mrogalski_looper::Handler [] [src]

pub trait Handler<EVENT: Send>: Sized {
    fn start(&mut self, sender: Sender<EVENT>);
fn handle(&mut self, event: EVENT) -> bool; fn end(self) { ... } }

Handles events sent to the event loop.

Required Methods

Called immediately after starting the event loop.

The Sender argument can be used to send new events. It can be cloned and passed to other threads in this method.

When the last sender is dropped and there are no events pending, the event loop terminates.

Called for every event sent to the event loop.

Provided Methods

Called after event loop terminates.

The default implementation does nothing and can be overriden.

Implementors