pub struct DeviceInfo {
pub id: DeviceId,
pub name: String,
pub product_id: u16,
pub vendor_id: u16,
pub usage_id: u16,
pub usage_page: u16,
/* private fields */
}Expand description
A struct containing basic information about a device
This struct can be obtained by calling DeviceInfo::enumerate and upgraded into a usable Device by calling DeviceInfo::open.
Fields§
§id: DeviceIdOS specific identifier
name: StringThe human readable name
product_id: u16The HID product id assigned to this device
vendor_id: u16The HID vendor id of the device’s manufacturer (i.e Logitech = 0x46D)
usage_id: u16The HID usage id
usage_page: u16The HID usage page
Implementations§
Source§impl DeviceInfo
impl DeviceInfo
Sourcepub fn enumerate() -> impl Future<Output = HidResult<impl Stream<Item = DeviceInfo> + Unpin + Send>>
pub fn enumerate() -> impl Future<Output = HidResult<impl Stream<Item = DeviceInfo> + Unpin + Send>>
Enumerates all accessible HID devices
If this library fails to retrieve the DeviceInfo of a device it will be automatically excluded.
Register a log compatible logger at trace level for more information about the discarded devices.
Sourcepub async fn open(&self, mode: AccessMode) -> HidResult<Device>
pub async fn open(&self, mode: AccessMode) -> HidResult<Device>
Opens the associated device in the requested AccessMode
Trait Implementations§
Source§impl Clone for DeviceInfo
impl Clone for DeviceInfo
Source§fn clone(&self) -> DeviceInfo
fn clone(&self) -> DeviceInfo
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DeviceInfo
impl Debug for DeviceInfo
Source§impl Hash for DeviceInfo
impl Hash for DeviceInfo
Source§impl PartialEq for DeviceInfo
impl PartialEq for DeviceInfo
Source§impl SerialNumberExt for DeviceInfo
impl SerialNumberExt for DeviceInfo
fn serial_number(&self) -> Option<&str>
impl Eq for DeviceInfo
Auto Trait Implementations§
impl Freeze for DeviceInfo
impl RefUnwindSafe for DeviceInfo
impl Send for DeviceInfo
impl Sync for DeviceInfo
impl Unpin for DeviceInfo
impl UnwindSafe for DeviceInfo
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