DeviceDescriptor

Struct DeviceDescriptor 

Source
pub struct DeviceDescriptor { /* private fields */ }
Expand description

A USB device descriptor.

There is one device descriptor provided by a D3XX device. This descriptor holds very basic information about the device, such as its identification, USB version, and function.

Implementations§

Source§

impl DeviceDescriptor

Source

pub fn serial_number(&self) -> &str

The device serial number.

Source

pub fn manufacturer(&self) -> &str

Human-readable manufacturer name.

Source

pub fn product(&self) -> &str

Human-readable product name.

Source

pub fn vendor_id(&self) -> usize

The vendor ID.

Source

pub fn product_id(&self) -> usize

The product ID.

Source

pub fn usb_version(&self) -> UsbVersion

The USB protocol version (e.g. USB 2.0)

Source

pub fn max_packet_size(&self) -> usize

The maximum size, in bytes, of a packet for an endpoint.

This is typically irrelevant for the user.

Source

pub fn class_codes(&self) -> ClassCodes

Returns a struct containing the interface class codes.

The codes are used to indicate the class, subclass, and protocol.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.