[][src]Struct hidapi::DeviceInfo

pub struct DeviceInfo { /* fields omitted */ }

Device information. Use accessors to extract information about Hid devices.

Note: Methods like serial_number() may return None, if the conversion to a String failed internally. You can however access the raw hid representation of the string by calling serial_number_raw()


impl DeviceInfo[src]

pub fn path(&self) -> &CStr[src]

pub fn vendor_id(&self) -> u16[src]

pub fn product_id(&self) -> u16[src]

pub fn serial_number(&self) -> Option<&str>[src]

Try to call serial_number_raw(), if None is returned.

pub fn serial_number_raw(&self) -> Option<&[wchar_t]>[src]

pub fn release_number(&self) -> u16[src]

pub fn manufacturer_string(&self) -> Option<&str>[src]

Try to call manufacturer_string_raw(), if None is returned.

pub fn manufacturer_string_raw(&self) -> Option<&[wchar_t]>[src]

pub fn product_string(&self) -> Option<&str>[src]

Try to call product_string_raw(), if None is returned.

pub fn product_string_raw(&self) -> Option<&[wchar_t]>[src]

pub fn usage_page(&self) -> u16[src]

pub fn usage(&self) -> u16[src]

pub fn interface_number(&self) -> i32[src]

pub fn open_device(&self, hidapi: &HidApi) -> HidResult<HidDevice>[src]

Use the information contained in DeviceInfo to open and return a handle to a HidDevice.

By default the device path is used to open the device. When no path is available, then vid, pid and serial number are used. If both path and serial number are not available, then this function will fail with HidError::OpenHidDeviceWithDeviceInfoError.

Note, that opening a device could still be done using HidApi::open() directly.

Trait Implementations

impl Clone for DeviceInfo[src]

impl Debug for DeviceInfo[src]

impl Into<HidDeviceInfo> for DeviceInfo[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.