usb_enumeration/
common.rs1use std::error::Error;
2
3#[derive(Debug, Clone, PartialEq, Eq, Hash)]
5pub struct UsbDevice {
6 pub id: String,
8 pub vendor_id: u16,
10 pub product_id: u16,
12 pub description: Option<String>,
14 pub serial_number: Option<String>,
16}
17
18#[derive(Copy, Clone, Debug)]
19pub struct ParseError;
20
21impl std::fmt::Display for ParseError {
22 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23 write!(f, "Parse Error")?;
24 Ok(())
25 }
26}
27
28impl Error for ParseError {
29 fn source(&self) -> Option<&(dyn Error + 'static)> {
30 None
31 }
32}