usb_device_descriptor

Struct usb_device_descriptor 

Source
#[repr(C, packed(1))]
pub struct usb_device_descriptor {
Show 14 fields pub bLength: u8, pub bDescriptorType: u8, pub bcdUSB: u16, pub bDeviceClass: u8, pub bDeviceSubClass: u8, pub bDeviceProtocol: u8, pub bMaxPacketSize0: u8, pub idVendor: u16, pub idProduct: u16, pub bcdDevice: u16, pub iManufacturer: u8, pub iProduct: u8, pub iSerialNumber: u8, pub bNumConfigurations: u8,
}
Expand description

Represents a USB device descriptor

A device descriptor describes general information about a USB device. It includes information that applies globally to the device and all of the device’s configurations. A USB device has only one device descriptor. A high-speed capable device that has different device information for full-speed and high-speed must also have a usb_qualifier_descriptor.

Fields§

§bLength: u8

<Size of the descriptor, in bytes.

§bDescriptorType: u8

<USB_DTYPE_DEVICE Device descriptor.

§bcdUSB: u16

<BCD of the supported USB specification.

§bDeviceClass: u8

<USB device class.

§bDeviceSubClass: u8

<USB device subclass.

§bDeviceProtocol: u8

<USB device protocol.

§bMaxPacketSize0: u8

<Size of the control endpoint’s bank in bytes.

§idVendor: u16

<Vendor ID for the USB product.

§idProduct: u16

<Unique product ID for the USB product.

§bcdDevice: u16

<Product release (version) number.

§iManufacturer: u8

<String index for the manufacturer’s name.

§iProduct: u8

<String index for the product name/details.

§iSerialNumber: u8

<String index for the product serial number.

§bNumConfigurations: u8

<Total number of configurations supported by the device.

Trait Implementations§

Source§

impl Clone for usb_device_descriptor

Source§

fn clone(&self) -> usb_device_descriptor

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for usb_device_descriptor

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for usb_device_descriptor

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.