Enum AnyUsbError

Source
pub enum AnyUsbError {
Show 18 variants EP0Stalled, EP0NotEmptyAfterSetup, EPWriteError, EPReadError, EPStalled, EPReadFailed, EP0BadGetStatusSize, EP0BadGetConfigSize, DataConversion, SetAddressFailed, InvalidDescriptorLength, InvalidDescriptorType, InvalidStringLength, UsbDeviceBuilder(BuilderError), UserDefined1, UserDefined2, UserDefinedU64(u64), UserDefinedString(String),
}
Expand description

Possible errors or other abnormal conditions.

Variants§

§

EP0Stalled

EP Stalled after Setup packet. Not necessarily an error, the Device rejected EP transaction. Next request should clear Stall for EP0.

§

EP0NotEmptyAfterSetup

EP0 buffer is not empty after Setup packet was consumed.

§

EPWriteError

Can’t get how many bytes were written. Usually, this is some internal error.

§

EPReadError

Can’t get how many bytes were read. Usually, this is some internal error.

§

EPStalled

EP Stalled. Not necessarily an error, the Device rejected EP transaction.

§

EPReadFailed

Error while reading from the endpoint. No data or data limit reached. Usually, this is some internal error.

§

EP0BadGetStatusSize

Bad reply length for GET_STATUS control request. Length should be 2. Usually, this is some internal error.

§

EP0BadGetConfigSize

Bad reply length for GET_CONFIGURATION control request. Length should be 1. Usually, this is some internal error.

§

DataConversion

Failed to convert one data representation to another, e.g. with TryInto. Usually, this is some internal error.

§

SetAddressFailed

SET_ADDRESS didn’t work during Device setup. Usually, this is some internal error.

§

InvalidDescriptorLength

Descriptor length is larger than the size of data returned.

§

InvalidDescriptorType

Unexpected Descriptor type.

§

InvalidStringLength

String Descriptor length is odd.

§

UsbDeviceBuilder(BuilderError)

Wrapper for BuilderError of usb-device when UsbDeviceBuilder fails.

§

UserDefined1

User-defined meaning. Enum value is passed through, not used by the library.

§

UserDefined2

User-defined meaning Enum value is passed through, not used by the library.

§

UserDefinedU64(u64)

User-defined meaning Enum value is passed through, not used by the library.

§

UserDefinedString(String)

User-defined meaning Enum value is passed through, not used by the library.

Trait Implementations§

Source§

impl Debug for AnyUsbError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for AnyUsbError

Source§

fn eq(&self, other: &AnyUsbError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for AnyUsbError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.