pub struct Device { /* private fields */ }
Expand description
A HID device that was detected by calling HidBackend::enumerate
Implementations§
Source§impl Device
impl Device
pub fn to_device_info(self) -> DeviceInfo
Sourcepub async fn open_readable(&self) -> HidResult<DeviceReader>
pub async fn open_readable(&self) -> HidResult<DeviceReader>
Open the device in read-only mode
Sourcepub async fn open_writeable(&self) -> HidResult<DeviceWriter>
pub async fn open_writeable(&self) -> HidResult<DeviceWriter>
Open the device in write-only mode Note: Not all backends support this mode and might upgrade the permission to read+write behind the scenes
Sourcepub async fn open(&self) -> HidResult<DeviceReaderWriter>
pub async fn open(&self) -> HidResult<DeviceReaderWriter>
Open the device in read and write mode
Methods from Deref<Target = DeviceInfo>§
Trait Implementations§
impl Eq for Device
Auto Trait Implementations§
impl Freeze for Device
impl RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnwindSafe for Device
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