Object for handling hidapi context and implementing RAII for it. Only one instance can exist at a time.
Initializes the hidapi.
Will also initialize the currently available device list.
pub fn refresh_devices(&mut self) -> HidResult<()>[src]
Refresh devices list and information about them (to access them use
pub fn devices(&self) -> &Vec<HidDeviceInfo>[src]
Returns vec of objects containing information about connected devices
pub fn device_list(&self) -> impl Iterator<Item = &DeviceInfo>[src]
Returns iterator containing information about attached HID devices.
Open a HID device using a Vendor ID (VID) and Product ID (PID).
When multiple devices with the same vid and pid are available, then the first one found in the internal device list will be used. There are however no guarantees, which device this will be.
Open a HID device using a Vendor ID (VID), Product ID (PID) and a serial number.
The path name be determined by inspecting the device list available with HidApi::devices()
Alternatively a platform-specific path name can be used (eg: /dev/hidraw0 on Linux).
impl RefUnwindSafe for HidApi
impl UnwindSafe for HidApi
type Error = Infallible
The type returned in the event of a conversion error.