pub struct Evdev { /* private fields */ }Expand description
The evdev pads on this machine, and their connection state.
Implementations§
Source§impl Evdev
impl Evdev
Sourcepub fn poll(&mut self, emit: impl FnMut(GamepadEvent)) -> Result<(), EvdevError>
pub fn poll(&mut self, emit: impl FnMut(GamepadEvent)) -> Result<(), EvdevError>
Reads every open pad and calls emit with what changed: connections,
disconnections, and snapshots that differ from the last one reported.
Open pads are read on every call; /dev/input is re-scanned for new
ones only once RESCAN_INTERVAL has passed
since the last scan.
§Errors
An EvdevError for the last thing that went wrong unexpectedly; see
its variants. Everything else was still polled.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Evdev
impl RefUnwindSafe for Evdev
impl Send for Evdev
impl Sync for Evdev
impl Unpin for Evdev
impl UnsafeUnpin for Evdev
impl UnwindSafe for Evdev
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more