pub enum Error {
DeviceNotFound,
DfuStatus {
status: Status,
state: State,
},
DfuInvalidDeviceStatus,
DfuSetAddressFailed(Status, State),
UsbContext(Error),
UsbDeviceEnumeration(Error),
UsbDeviceOpen(Error),
UsbKernelDriverDetach(Error),
UsbClaimInterface(Error),
UsbSetAltSetting(Error),
UsbControlTransfer(TransferError),
}Expand description
Error type
Many of the errors are wrappers around nusb::Error and
nusb::transfer::TransferError, and are often
somewhat esoteric. Error::usb_stack_error() can be used to retrieve
the underlying USB stack error for further analysis, or test whether the
failure was a USB stack one.
Variants§
DeviceNotFound
DFU Device not found
DfuStatus
DFU status error returned by device
DfuInvalidDeviceStatus
Invalid DFU device status response
DfuSetAddressFailed(Status, State)
DFU set address pointer failed
UsbContext(Error)
UsbDeviceEnumeration(Error)
UsbDeviceOpen(Error)
UsbKernelDriverDetach(Error)
UsbClaimInterface(Error)
UsbSetAltSetting(Error)
UsbControlTransfer(TransferError)
Implementations§
Source§impl Error
impl Error
Sourcepub fn usb_stack_error(&self) -> Option<UsbStackError>
pub fn usb_stack_error(&self) -> Option<UsbStackError>
Returns the underlying USB stack error if applicable.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl UnwindSafe for Error
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