pub struct UsbDevice {Show 16 fields
pub path: String,
pub bus_id: String,
pub bus_num: u32,
pub dev_num: u32,
pub speed: u32,
pub vendor_id: u16,
pub product_id: u16,
pub device_bcd: Version,
pub device_class: u8,
pub device_subclass: u8,
pub device_protocol: u8,
pub configuration_value: u8,
pub num_configurations: u8,
pub interfaces: Vec<UsbInterface>,
pub device_handler: Option<Arc<Mutex<Box<dyn UsbDeviceHandler + Send>>>>,
pub usb_version: Version,
/* private fields */
}
Expand description
Represent a USB device
Fields§
§path: String
§bus_id: String
§bus_num: u32
§dev_num: u32
§speed: u32
§vendor_id: u16
§product_id: u16
§device_bcd: Version
§device_class: u8
§device_subclass: u8
§device_protocol: u8
§configuration_value: u8
§num_configurations: u8
§interfaces: Vec<UsbInterface>
§device_handler: Option<Arc<Mutex<Box<dyn UsbDeviceHandler + Send>>>>
§usb_version: Version
Implementations§
source§impl UsbDevice
impl UsbDevice
pub fn new(index: u32) -> Self
sourcepub fn set_configuration_name(&mut self, name: &str) -> Option<String>
pub fn set_configuration_name(&mut self, name: &str) -> Option<String>
Returns the old value, if present.
sourcepub fn set_serial_number(&mut self, name: &str) -> Option<String>
pub fn set_serial_number(&mut self, name: &str) -> Option<String>
Returns the old value, if present.
sourcepub fn set_product_name(&mut self, name: &str) -> Option<String>
pub fn set_product_name(&mut self, name: &str) -> Option<String>
Returns the old value, if present.
sourcepub fn set_manufacturer_name(&mut self, name: &str) -> Option<String>
pub fn set_manufacturer_name(&mut self, name: &str) -> Option<String>
Returns the old value, if present.
pub fn with_interface( self, interface_class: u8, interface_subclass: u8, interface_protocol: u8, name: &str, endpoints: Vec<UsbEndpoint>, handler: Arc<Mutex<Box<dyn UsbInterfaceHandler + Send>>> ) -> Self
pub fn with_device_handler( self, handler: Arc<Mutex<Box<dyn UsbDeviceHandler + Send>>> ) -> Self
Trait Implementations§
Auto Trait Implementations§
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