pub struct UsbDevice { /* private fields */ }
Expand description
A USB device.
Implementationsยง
Sourceยงimpl UsbDevice
impl UsbDevice
Sourcepub fn product_id(&self) -> u16
pub fn product_id(&self) -> u16
Manufacturer-provided product identifier.
Sourcepub fn device_class(&self) -> u8
pub fn device_class(&self) -> u8
Device class code.
Sourcepub fn device_subclass(&self) -> u8
pub fn device_subclass(&self) -> u8
Device subclass code.
Sourcepub fn device_protocol(&self) -> u8
pub fn device_protocol(&self) -> u8
Device protocol code.
Sourcepub fn device_version_major(&self) -> u8
pub fn device_version_major(&self) -> u8
Major version of the device.
Sourcepub fn device_version_minor(&self) -> u8
pub fn device_version_minor(&self) -> u8
Minor version of the device.
Sourcepub fn device_version_subminor(&self) -> u8
pub fn device_version_subminor(&self) -> u8
Subminor version of the device.
Sourcepub fn usb_version_major(&self) -> u8
pub fn usb_version_major(&self) -> u8
Major version of USB protocol version supported by the device.
Sourcepub fn usb_version_minor(&self) -> u8
pub fn usb_version_minor(&self) -> u8
Minor version of USB protocol version supported by the device.
Sourcepub fn usb_version_subminor(&self) -> u8
pub fn usb_version_subminor(&self) -> u8
Subminor version of USB protocol version supported by the device.
Sourcepub fn manufacturer_name(&self) -> Option<String>
pub fn manufacturer_name(&self) -> Option<String>
Optional manufacturer name.
Sourcepub fn product_name(&self) -> Option<String>
pub fn product_name(&self) -> Option<String>
Optional product name.
Sourcepub fn serial_number(&self) -> Option<String>
pub fn serial_number(&self) -> Option<String>
Optional serial number of the device.
Sourcepub fn configuration(&self) -> Option<UsbConfiguration>
pub fn configuration(&self) -> Option<UsbConfiguration>
Active configuration value if any.
Sourcepub fn configurations(&self) -> Vec<UsbConfiguration>
pub fn configurations(&self) -> Vec<UsbConfiguration>
All available configurations for this device.
Sourcepub async fn forget(self)
pub async fn forget(self)
End the device session and relinquish all obtained permissions to access the USB device.
Sourcepub async fn open(&self) -> Result<OpenUsbDevice>
pub async fn open(&self) -> Result<OpenUsbDevice>
Open the USB device to allow USB transfers.
A device can only be open once.
Trait Implementationsยง
Sourceยงimpl AsRef<UsbDevice> for OpenUsbDevice
impl AsRef<UsbDevice> for OpenUsbDevice
impl Eq for UsbDevice
impl StructuralPartialEq for UsbDevice
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