#[non_exhaustive]pub enum ClassError {
Transfer(PipeError),
NoMatch,
NoPipe,
InvalidDescriptor,
InvalidResponse,
RequestFailed,
Unsupported(&'static str),
}Expand description
Shared error type for host class drivers.
Class-specific error enums can wrap this type or convert into it. New code
should prefer returning ClassError directly so applications can handle
the common cases uniformly.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Transfer(PipeError)
A pipe transfer failed.
NoMatch
The class is not present in the configuration descriptor.
NoPipe
No free pipe was available for one of the endpoints.
InvalidDescriptor
A descriptor or a class response was malformed.
InvalidResponse
The device returned a well-formed but unexpected response.
RequestFailed
A control request was not acknowledged by the device.
Unsupported(&'static str)
The class or a requested feature is not supported.
Trait Implementations§
Source§impl Debug for ClassError
impl Debug for ClassError
Source§impl Display for ClassError
impl Display for ClassError
Source§impl Error for ClassError
impl Error for ClassError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl Error for ClassError
Available on crate feature embedded-io only.
impl Error for ClassError
Available on crate feature
embedded-io only.Source§impl Format for ClassError
impl Format for ClassError
Source§impl From<CcidError> for ClassError
impl From<CcidError> for ClassError
Source§impl From<CdcAcmError> for ClassError
impl From<CdcAcmError> for ClassError
Source§fn from(e: CdcAcmError) -> Self
fn from(e: CdcAcmError) -> Self
Converts to this type from the input type.
Source§impl From<GipError> for ClassError
impl From<GipError> for ClassError
Source§impl From<HidError> for ClassError
impl From<HidError> for ClassError
Source§impl From<HostError> for ClassError
impl From<HostError> for ClassError
Source§impl From<MidiError> for ClassError
impl From<MidiError> for ClassError
Source§impl From<MscError> for ClassError
impl From<MscError> for ClassError
Auto Trait Implementations§
impl Forget for ClassError
impl Freeze for ClassError
impl Move for ClassError
impl RefUnwindSafe for ClassError
impl Send for ClassError
impl Sync for ClassError
impl Unpin for ClassError
impl UnsafeUnpin for ClassError
impl UnwindSafe for ClassError
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