pub struct UsbDevice<'a, B: UsbBus> { /* private fields */ }Expand description
USB composite device.
Ties together the bus driver, a control-transfer state machine, and one or
more UsbClass implementations.
The lifetime 'a is the lifetime of the UsbBusAllocator from which this
device and all classes were built.
Implementations§
Source§impl<'a, B: UsbBus> UsbDevice<'a, B>
impl<'a, B: UsbBus> UsbDevice<'a, B>
Sourcepub fn state(&self) -> DeviceState
pub fn state(&self) -> DeviceState
Current device state.
Sourcepub fn is_configured(&self) -> bool
pub fn is_configured(&self) -> bool
true if the device is fully configured.
Sourcepub fn remote_wakeup_enabled(&self) -> bool
pub fn remote_wakeup_enabled(&self) -> bool
Whether host remote wake-up is currently enabled.
Sourcepub fn set_self_powered(&mut self, is_self_powered: bool)
pub fn set_self_powered(&mut self, is_self_powered: bool)
Override the self-powered flag at runtime.
Sourcepub fn force_reset(&mut self) -> UsbResult<()>
pub fn force_reset(&mut self) -> UsbResult<()>
Force a USB disconnect + re-enumeration (not supported on all buses).
Auto Trait Implementations§
impl<'a, B> Forget for UsbDevice<'a, B>
impl<'a, B> Freeze for UsbDevice<'a, B>
impl<'a, B> Move for UsbDevice<'a, B>
impl<'a, B> RefUnwindSafe for UsbDevice<'a, B>where
&'a B: RefUnwindSafe,
impl<'a, B> Send for UsbDevice<'a, B>
impl<'a, B> Sync for UsbDevice<'a, B>
impl<'a, B> Unpin for UsbDevice<'a, B>
impl<'a, B> UnsafeUnpin for UsbDevice<'a, B>where
&'a B: UnsafeUnpin,
impl<'a, B> UnwindSafe for UsbDevice<'a, B>where
&'a B: UnwindSafe,
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