pub struct Nusb;Expand description
Entry point for the USB backend; behind a crate::Hidra built with
Nusb. See the module docs for
when to prefer it.
The raw-USB backend: HID reports over nusb transfers.
Trait Implementations§
Source§impl HidBackend for NusbApi
impl HidBackend for NusbApi
Source§fn enumerate(
&self,
vendor_id: u16,
product_id: u16,
) -> HidResult<Vec<DeviceInfo>>
fn enumerate( &self, vendor_id: u16, product_id: u16, ) -> HidResult<Vec<DeviceInfo>>
Enumerate connected USB HID interfaces. vendor_id/product_id of 0
act as wildcards.
Usage page/usage require reading each device’s report descriptor, which needs the device opened; this is attempted best-effort and the fields stay 0/0 when the device cannot be opened (e.g. missing udev permissions).
Source§fn open_path(&self, path: &str) -> HidResult<NusbDevice>
fn open_path(&self, path: &str) -> HidResult<NusbDevice>
Open a device by usb:<bus>:<device-address>:<interface> path, as
reported by HidBackend::enumerate.
Source§type Device = NusbDevice
type Device = NusbDevice
The open-device handle this backend produces.
Auto Trait Implementations§
impl Freeze for NusbApi
impl RefUnwindSafe for NusbApi
impl Send for NusbApi
impl Sync for NusbApi
impl Unpin for NusbApi
impl UnsafeUnpin for NusbApi
impl UnwindSafe for NusbApi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more