Struct hidapi::DeviceInfo [−][src]
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()
Implementations
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]
fn clone(&self) -> DeviceInfo
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for DeviceInfo
[src]
impl Into<HidDeviceInfo> for DeviceInfo
[src]
fn into(self) -> HidDeviceInfo
[src]
Auto Trait Implementations
impl RefUnwindSafe for DeviceInfo
impl Send for DeviceInfo
impl Sync for DeviceInfo
impl Unpin for DeviceInfo
impl UnwindSafe for DeviceInfo
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,