Skip to main content

DeviceInfo

Struct DeviceInfo 

Source
pub struct DeviceInfo<'a> {
Show 14 fields pub vendor_id: u16, pub product_id: u16, pub device_class: u8, pub device_sub_class: u8, pub device_protocol: u8, pub max_packet_size_0: u8, pub device_release: u16, pub usb_rev: u16, pub manufacturer: Option<&'a str>, pub product: Option<&'a str>, pub serial_number: Option<&'a str>, pub self_powered: bool, pub supports_remote_wakeup: bool, pub max_power: u8,
}
Expand description

Static device metadata. Passed to UsbDeviceBuilder via the fluent API.

Fields§

§vendor_id: u16

Vendor ID (USB-IF assigned).

§product_id: u16

Product ID.

§device_class: u8

Device class code (0 = specified at interface level).

§device_sub_class: u8

Device subclass code.

§device_protocol: u8

Device protocol code.

§max_packet_size_0: u8

Maximum EP0 packet size — must be 8, 16, 32 or 64.

§device_release: u16

Device release in BCD (e.g. 0x0100 = 1.00).

§usb_rev: u16

USB spec compliance: 0x0200 = USB 2.0, 0x0210 = USB 2.1.

§manufacturer: Option<&'a str>

Manufacturer string (English).

§product: Option<&'a str>

Product string (English).

§serial_number: Option<&'a str>

Serial number string (English).

§self_powered: bool

true if the device has its own power supply.

§supports_remote_wakeup: bool

true if the device can signal remote wake-up.

§max_power: u8

Maximum power draw in 2 mA units (e.g. 50 = 100 mA).

Auto Trait Implementations§

§

impl<'a> Forget for DeviceInfo<'a>

§

impl<'a> Freeze for DeviceInfo<'a>

§

impl<'a> Move for DeviceInfo<'a>

§

impl<'a> RefUnwindSafe for DeviceInfo<'a>

§

impl<'a> Send for DeviceInfo<'a>

§

impl<'a> Sync for DeviceInfo<'a>

§

impl<'a> Unpin for DeviceInfo<'a>

§

impl<'a> UnsafeUnpin for DeviceInfo<'a>

§

impl<'a> UnwindSafe for DeviceInfo<'a>

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.