[][src]Struct usb_ids::Device

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.

Implementations

impl Device[src]

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
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.