Struct usb_ids::Device[][src]

pub struct Device { /* fields omitted */ }

Represents a single device in the USB database.

Every device has a corresponding vendor, a device ID, a pretty name, and a list of associated Interfaces.


impl Device[src]

pub fn from_vid_pid(vid: u16, pid: u16) -> Option<&'static Device>[src]

Returns the Device corresponding to the given vendor and product IDs, or None if no such device exists in the DB.

pub fn vendor(&self) -> &'static Vendor[src]

Returns the Vendor that this device belongs to.

Looking up a vendor by device is cheap (O(1)).

pub fn as_vid_pid(&self) -> (u16, u16)[src]

Returns a tuple of (vendor id, device/"product" id) for this device.

This is convenient for interactions with other USB libraries.

pub fn id(&self) -> u16[src]

Returns the device's ID.

pub fn name(&self) -> &'static str[src]

Returns the device's name.

pub fn interfaces(&self) -> impl Iterator<Item = &'static Interface>[src]

Returns an iterator over the device's interfaces.

NOTE: The USB database does not include interface information for most devices. This list is not authoritative.

Trait Implementations

impl Clone for Device[src]

impl Copy for Device[src]

impl Debug for Device[src]

impl PartialEq<Device> for Device[src]

impl StructuralPartialEq for Device[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.