Trait rat_event::HandleEvent

source ·
pub trait HandleEvent<Event, KeyMap, R: ConsumedEvent> {
    // Required method
    fn handle(&mut self, event: &Event, keymap: KeyMap) -> R;
}
Expand description

A very broad trait for an event handler for widgets.

As widget types are only short-lived, this trait should be implemented for the state type. Thereby it can modify any state, and it can return an arbitrary result, that fits the widget.

Required Methods§

source

fn handle(&mut self, event: &Event, keymap: KeyMap) -> R

Handle an event.

  • self - Should be the widget state.
  • event - Event
  • keymap - Which keymapping. Predefined are FocusKeys and MouseOnly.

Implementors§