#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "defmt-03", derive(defmt::Format))]
pub enum WireError {
ReadBufferTooShort,
WriteBufferTooShort,
InvalidValue,
ArrayLength,
InvalidUtf8,
}
#[cfg(feature = "std")]
impl std::error::Error for WireError {}
impl core::fmt::Display for WireError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
WireError::ReadBufferTooShort => {
write!(f, "Read buffer too short to extract type from")
}
WireError::WriteBufferTooShort => {
write!(f, "Write buffer too short to pack type into")
}
WireError::InvalidValue => f.write_str("Invalid decoded value"),
WireError::ArrayLength => f.write_str("Incorrect array length"),
WireError::InvalidUtf8 => f.write_str("Invalid UTF8"),
}
}
}