UsbDeviceInfo

Struct UsbDeviceInfo 

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

Generic info about a USB device.

Returned by scan_usb.

Implementations§

Source§

impl UsbDeviceInfo

Source

pub fn vid(&self) -> u16

Returns the vendor ID.

Vendor IDs are centrally registered and can be looked up for example at http://www.linux-usb.org/usb.ids.

Source

pub fn pid(&self) -> u16

Returns the product ID.

Source

pub fn bus_number(&self) -> u8

Returns the bus this device is attached to.

Source

pub fn address(&self) -> u8

Returns the device address on the bus it’s attached to.

Source

pub fn port_number(&self) -> u8

Returns the port the device is attached to.

Source

pub fn open(self) -> Result<JayLink>

Tries to open this USB device.

If successful, returns a JayLink instance.

This method is equivalent to JayLink::open_usb.

Trait Implementations§

Source§

impl Debug for UsbDeviceInfo

Source§

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

Formats the value using the given formatter. Read more

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.