pub fn to_option(self) -> EventOption {
        match self.code {
            EVENT_NONE => EventOption::None,
            EVENT_KEY => EventOption::Key(KeyEvent::from_event(self)),
            EVENT_MOUSE => EventOption::Mouse(MouseEvent::from_event(self)),
            EVENT_MOUSE_RELATIVE => EventOption::MouseRelative(MouseRelativeEvent::from_event(self)),
            EVENT_BUTTON => EventOption::Button(ButtonEvent::from_event(self)),
            EVENT_SCROLL => EventOption::Scroll(ScrollEvent::from_event(self)),
            EVENT_QUIT => EventOption::Quit(QuitEvent::from_event(self)),
            EVENT_FOCUS => EventOption::Focus(FocusEvent::from_event(self)),
            EVENT_MOVE => EventOption::Move(MoveEvent::from_event(self)),
            EVENT_RESIZE => EventOption::Resize(ResizeEvent::from_event(self)),
            EVENT_SCREEN => EventOption::Screen(ScreenEvent::from_event(self)),
            EVENT_CLIPBOARD => EventOption::Clipboard(ClipboardEvent::from_event(self)),
            _ => EventOption::Unknown(self),
        }
    }
/// Convert the event ot an optional event
// TODO: Consider doing this via a From trait.
Convert the event ot an optional event
TODO: Consider doing this via a From trait.
Convert the event ot an optional event TODO : Consider doing this via a From trait .
pub fn to_option(self) -> EventOption {
        match self.code {
            EVENT_NONE => EventOption::None,
            EVENT_KEY => EventOption::Key(KeyEvent::from_event(self)),
            EVENT_MOUSE => EventOption::Mouse(MouseEvent::from_event(self)),
            EVENT_MOUSE_RELATIVE => EventOption::MouseRelative(MouseRelativeEvent::from_event(self)),
            EVENT_BUTTON => EventOption::Button(ButtonEvent::from_event(self)),
            EVENT_SCROLL => EventOption::Scroll(ScrollEvent::from_event(self)),
            EVENT_QUIT => EventOption::Quit(QuitEvent::from_event(self)),
            EVENT_FOCUS => EventOption::Focus(FocusEvent::from_event(self)),
            EVENT_MOVE => EventOption::Move(MoveEvent::from_event(self)),
            EVENT_RESIZE => EventOption::Resize(ResizeEvent::from_event(self)),
            EVENT_SCREEN => EventOption::Screen(ScreenEvent::from_event(self)),
            EVENT_CLIPBOARD => EventOption::Clipboard(ClipboardEvent::from_event(self)),
            _ => EventOption::Unknown(self),
        }
    }
pub fn to_option ( self ) -> EventOption { match self . code { EVENT_NONE => EventOption :: None , EVENT_KEY => EventOption :: Key ( KeyEvent :: from_event ( self ) ) , EVENT_MOUSE => EventOption :: Mouse ( MouseEvent :: from_event ( self ) ) , EVENT_MOUSE_RELATIVE => EventOption :: MouseRelative ( MouseRelativeEvent :: from_event ( self ) ) , EVENT_BUTTON => EventOption :: Button ( ButtonEvent :: from_event ( self ) ) , EVENT_SCROLL => EventOption :: Scroll ( ScrollEvent :: from_event ( self ) ) , EVENT_QUIT => EventOption :: Quit ( QuitEvent :: from_event ( self ) ) , EVENT_FOCUS => EventOption :: Focus ( FocusEvent :: from_event ( self ) ) , EVENT_MOVE => EventOption :: Move ( MoveEvent :: from_event ( self ) ) , EVENT_RESIZE => EventOption :: Resize ( ResizeEvent :: from_event ( self ) ) , EVENT_SCREEN => EventOption :: Screen ( ScreenEvent :: from_event ( self ) ) , EVENT_CLIPBOARD => EventOption :: Clipboard ( ClipboardEvent :: from_event ( self ) ) , _ => EventOption :: Unknown ( self ) , } }
Convert the event ot an optional event
TODO: Consider doing this via a From trait.
Convert the event ot an optional event TODO : Consider doing this via a From trait .
self
self