denise_evdev/error.rs
1//! Failures from the evdev backend.
2
3use std::io;
4use std::path::PathBuf;
5
6/// Something went wrong reading input devices.
7#[derive(Debug, thiserror::Error)]
8#[non_exhaustive]
9pub enum EvdevError {
10 /// `/dev/input` could not be listed.
11 #[error("listing input devices")]
12 Enumerate(#[source] io::Error),
13
14 /// A device node could not be opened.
15 ///
16 /// Almost always a permission problem: reading `/dev/input/event*` needs the
17 /// `input` group.
18 #[error("opening {path}")]
19 Open {
20 /// The device that failed.
21 path: PathBuf,
22 /// The underlying failure.
23 #[source]
24 source: io::Error,
25 },
26
27 /// No device that this backend can use was found.
28 #[error("no usable pointer, touch or keyboard device found")]
29 NoDevices,
30}