Struct Descriptor

Source
pub struct Descriptor {
    pub bDeviceClass: u8,
    pub bDeviceSubClass: u8,
    pub bDeviceProtocol: u8,
    pub bMaxPacketSize0: bMaxPacketSize0,
    pub idVendor: u16,
    pub idProduct: u16,
    pub bcdDevice: u16,
    pub iManufacturer: Option<NonZeroU8>,
    pub iProduct: Option<NonZeroU8>,
    pub iSerialNumber: Option<NonZeroU8>,
    pub bNumConfigurations: NonZeroU8,
}
Expand description

Device descriptor

Fields§

§bDeviceClass: u8

Device class

§bDeviceSubClass: u8

Device subclass

§bDeviceProtocol: u8

Device protocol

§bMaxPacketSize0: bMaxPacketSize0

Maximum packet size

§idVendor: u16

Vendor ID

§idProduct: u16

Product ID

§bcdDevice: u16

Device release number

§iManufacturer: Option<NonZeroU8>

Manufacturer string index

§iProduct: Option<NonZeroU8>

Product string index

§iSerialNumber: Option<NonZeroU8>

Serial number string index

§bNumConfigurations: NonZeroU8

Number of configurations

Implementations§

Source§

impl Descriptor

Source

pub const SIZE: u8 = 18u8

The size of this descriptor on the wire

Source

pub fn bytes(&self) -> [u8; 18]

Returns the wire representation of this device endpoint

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.