Struct rusb::DeviceDescriptor

source ·
pub struct DeviceDescriptor { /* private fields */ }
Expand description

Describes a device.

Implementations§

source§

impl DeviceDescriptor

source

pub fn usb_version(&self) -> Version

Returns the device’s maximum supported USB version.

source

pub fn device_version(&self) -> Version

Returns the manufacturer’s version of the device.

source

pub fn manufacturer_string_index(&self) -> Option<u8>

Returns the index of the string descriptor that contains the manufacturer name.

source

pub fn product_string_index(&self) -> Option<u8>

Returns the index of the string descriptor that contains the product name.

source

pub fn serial_number_string_index(&self) -> Option<u8>

Returns the index of the string descriptor that contains the device’s serial number.

source

pub fn class_code(&self) -> u8

Returns the device’s class code.

source

pub fn sub_class_code(&self) -> u8

Returns the device’s sub class code.

source

pub fn protocol_code(&self) -> u8

Returns the device’s protocol code.

source

pub fn vendor_id(&self) -> u16

Returns the device’s vendor ID.

source

pub fn product_id(&self) -> u16

Returns the device’s product ID.

source

pub fn max_packet_size(&self) -> u8

Returns the maximum packet size of the device’s first endpoint.

source

pub fn num_configurations(&self) -> u8

Returns the number of config descriptors available for the device.

Trait Implementations§

source§

impl Debug for DeviceDescriptor

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.