pub enum KMError {
DeviceNotFound,
Usb(Error),
Io(Error),
Timeout(Elapsed),
Protocol(String),
InvalidPacket(String),
InsufficientData {
expected: usize,
actual: usize,
},
ParseError {
offset: usize,
message: String,
},
AttributeMismatch {
expected: Vec<u16>,
actual: Vec<u16>,
},
UnsupportedSerialization {
packet: &'static str,
},
}Expand description
The primary error type for the km003c-rs library.
Variants§
DeviceNotFound
Usb(Error)
Io(Error)
Timeout(Elapsed)
Protocol(String)
InvalidPacket(String)
InsufficientData
ParseError
AttributeMismatch
UnsupportedSerialization
Trait Implementations§
Source§impl Error for KMError
impl Error for KMError
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 From<TryFromSliceError> for KMError
impl From<TryFromSliceError> for KMError
Source§fn from(_: TryFromSliceError) -> Self
fn from(_: TryFromSliceError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for KMError
impl !UnwindSafe for KMError
impl Freeze for KMError
impl Send for KMError
impl Sync for KMError
impl Unpin for KMError
impl UnsafeUnpin for KMError
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