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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 280 bytes