Struct DfuState
pub struct DfuState<H>where
H: Handler,{ /* private fields */ }Expand description
Internal state for the DFU class
Implementations§
§impl<H> DfuState<H>where
H: Handler,
impl<H> DfuState<H>where
H: Handler,
pub fn new(handler: H, attrs: DfuAttributes, timeout: Duration) -> DfuState<H>
pub fn new(handler: H, attrs: DfuAttributes, timeout: Duration) -> DfuState<H>
Create a new DFU instance to expose a DFU interface.
pub fn handler_mut(&mut self) -> &mut H
pub fn handler_mut(&mut self) -> &mut H
Get a mutable reference to the handler.
Trait Implementations§
§impl<H> Handler for DfuState<H>where
H: Handler,
impl<H> Handler for DfuState<H>where
H: Handler,
§fn control_out(&mut self, req: Request, _: &[u8]) -> Option<OutResponse>
fn control_out(&mut self, req: Request, _: &[u8]) -> Option<OutResponse>
Called when a control request is received with direction HostToDevice. Read more
§fn control_in<'a>(
&'a mut self,
req: Request,
buf: &'a mut [u8],
) -> Option<InResponse<'a>>
fn control_in<'a>( &'a mut self, req: Request, buf: &'a mut [u8], ) -> Option<InResponse<'a>>
Called when a control request is received with direction DeviceToHost. Read more
§fn configured(&mut self, _configured: bool)
fn configured(&mut self, _configured: bool)
Called when the host has enabled or disabled the configuration of the device.
§fn suspended(&mut self, _suspended: bool)
fn suspended(&mut self, _suspended: bool)
Called when the bus has entered or exited the suspend state.
§fn remote_wakeup_enabled(&mut self, _enabled: bool)
fn remote_wakeup_enabled(&mut self, _enabled: bool)
Called when remote wakeup feature is enabled or disabled.
§fn set_alternate_setting(
&mut self,
iface: InterfaceNumber,
alternate_setting: u8,
)
fn set_alternate_setting( &mut self, iface: InterfaceNumber, alternate_setting: u8, )
Called when a “set alternate setting” control request is done on the interface.
§fn get_string(&mut self, index: StringIndex, lang_id: u16) -> Option<&str>
fn get_string(&mut self, index: StringIndex, lang_id: u16) -> Option<&str>
Called when a GET_DESCRIPTOR STRING control request is received.
Auto Trait Implementations§
impl<H> Freeze for DfuState<H>where
H: Freeze,
impl<H> RefUnwindSafe for DfuState<H>where
H: RefUnwindSafe,
impl<H> Send for DfuState<H>where
H: Send,
impl<H> Sync for DfuState<H>where
H: Sync,
impl<H> Unpin for DfuState<H>where
H: Unpin,
impl<H> UnsafeUnpin for DfuState<H>where
H: UnsafeUnpin,
impl<H> UnwindSafe for DfuState<H>where
H: 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