1use crate::event::QuitEvent;
2use crate::poll::PollEvents;
3use crate::Control;
4use std::any::Any;
5
6#[derive(Debug, Default)]
10pub struct PollQuit;
11
12impl<Event, Error> PollEvents<Event, Error> for PollQuit
13where
14 Event: 'static + From<QuitEvent>,
15 Error: 'static,
16{
17 fn as_any(&self) -> &dyn Any {
18 self
19 }
20
21 fn poll(&mut self) -> Result<bool, Error> {
22 Ok(false)
23 }
24
25 fn read(&mut self) -> Result<Control<Event>, Error> {
26 Ok(Control::Event(Event::from(QuitEvent)))
27 }
28}