#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SerialError {
BufferTooSmall,
InvalidEscape,
TruncatedFrame,
}
impl core::fmt::Display for SerialError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
SerialError::BufferTooSmall => {
f.write_str("serial output buffer is too small for the frame")
}
SerialError::InvalidEscape => {
f.write_str("serial frame contains an invalid SLIP escape sequence")
}
SerialError::TruncatedFrame => f.write_str("serial frame is truncated"),
}
}
}
impl core::error::Error for SerialError {}