pub struct Device { /* private fields */ }Expand description
USB device wrapper
Implementations§
Source§impl Device
impl Device
Sourcepub fn refresh(&mut self) -> Result<bool, Error>
pub fn refresh(&mut self) -> Result<bool, Error>
- Find this device
- Compare
modeofthisvs. just found - [if changed] Update state of
this, drop all pending transfers if needed to prevent future errors when send to unexisting interface. - Return
trueifmodechanged.
Sourcepub fn open(&mut self) -> Result<(), Error>
pub fn open(&mut self) -> Result<(), Error>
Open USB interface if available, otherwise try open serial port if available.
pub fn interface_mut(&mut self) -> Result<&mut Interface, Error>
pub fn set_interface(&mut self, interface: Interface)
pub fn close(&mut self)
pub fn close_with_reset(&mut self) -> Result<(), Error>
Trait Implementations§
Source§impl AsRef<DeviceInfo> for Device
impl AsRef<DeviceInfo> for Device
Source§fn as_ref(&self) -> &DeviceInfo
fn as_ref(&self) -> &DeviceInfo
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl DeviceMode for Device
impl DeviceMode for Device
Source§impl HaveDataInterface for Device
impl HaveDataInterface for Device
fn data_interface_number(&self) -> Option<u8>
fn have_data_interface(&self) -> bool
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