#[derive(Debug, PartialEq)]
pub enum Error<E> {
Bcc,
BufferOverflow,
Collision,
Crc,
IncompleteFrame,
Overheating,
Parity,
Protocol,
Timeout,
Wr,
Nak,
NoRoom,
Proprietary,
Comm(E),
}
#[cfg(feature = "std")]
impl<E> std::fmt::Display for Error<E> {
fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
Ok(())
}
}
#[cfg(feature = "std")]
impl<E> std::error::Error for Error<E>
where
E: std::fmt::Debug,
{
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
None
}
fn description(&self) -> &str {
"description() is deprecated; use Display"
}
fn cause(&self) -> Option<&dyn std::error::Error> {
self.source()
}
}