Fetches and returns events from the kernel ring buffer without doing synchronization on SYN_DROPPED. By default this will block until events are available. Typically, users will want to call this in a tight loop within a thread.
(&mut self)
| 397 | /// By default this will block until events are available. Typically, users will want to call |
| 398 | /// this in a tight loop within a thread. |
| 399 | pub fn fetch_events(&mut self) -> io::Result<impl Iterator<Item = InputEvent> + '_> { |
| 400 | self.fill_events()?; |
| 401 | Ok(self.event_buf.drain(..).map(InputEvent::from)) |
| 402 | } |
| 403 | |
| 404 | #[cfg(feature = "tokio")] |
| 405 | #[inline] |