pub struct USBDevice {
pub vendor_id: String,
pub product_id: String,
pub vendor_name: String,
pub product_name: String,
pub device_class: String,
pub usb_version: String,
pub serial_number: Option<String>,
pub bus_number: u8,
pub device_address: u8,
pub port_path: Option<String>,
pub driver: Option<String>,
pub connected: bool,
}
Expand description
USB device information
Fields§
§vendor_id: String
USB vendor ID
product_id: String
USB product ID
vendor_name: String
Vendor name
product_name: String
Product name
device_class: String
USB device class
usb_version: String
USB version (1.0, 1.1, 2.0, 3.0, etc.)
serial_number: Option<String>
Serial number (if available)
bus_number: u8
Bus number
device_address: u8
Device address
port_path: Option<String>
Port path
driver: Option<String>
Driver name (if loaded)
connected: bool
Is device currently connected
Implementations§
Source§impl USBDevice
impl USBDevice
Sourcepub fn product_id(&self) -> &str
pub fn product_id(&self) -> &str
Get product ID
Sourcepub fn vendor_name(&self) -> &str
pub fn vendor_name(&self) -> &str
Get vendor name
Sourcepub fn product_name(&self) -> &str
pub fn product_name(&self) -> &str
Get product name
Sourcepub fn device_class(&self) -> &str
pub fn device_class(&self) -> &str
Get device class
Sourcepub fn usb_version(&self) -> &str
pub fn usb_version(&self) -> &str
Get USB version
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if device is connected
Sourcepub fn is_storage_device(&self) -> bool
pub fn is_storage_device(&self) -> bool
Check if device is a storage device
Sourcepub fn is_input_device(&self) -> bool
pub fn is_input_device(&self) -> bool
Check if device is an input device
Sourcepub fn is_audio_device(&self) -> bool
pub fn is_audio_device(&self) -> bool
Check if device is an audio device
Sourcepub fn is_video_device(&self) -> bool
pub fn is_video_device(&self) -> bool
Check if device is a video device
Sourcepub fn is_high_speed(&self) -> bool
pub fn is_high_speed(&self) -> bool
Check if device supports USB 3.0 or higher
Trait Implementations§
Source§impl<'de> Deserialize<'de> for USBDevice
impl<'de> Deserialize<'de> for USBDevice
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for USBDevice
impl RefUnwindSafe for USBDevice
impl Send for USBDevice
impl Sync for USBDevice
impl Unpin for USBDevice
impl UnwindSafe for USBDevice
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