modbus_rtu/common/
packet_error.rs1use super::exception::Exception;
2
3
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5#[repr(u8)]
6pub enum PacketError {
7 TooShort(usize),
8 CrcMismatch { expected: [u8; 2], found: [u8; 2] },
9 NotMyId(u8),
10 Exeption(Exception),
11}
12
13
14#[cfg(feature = "std")]
15impl std::fmt::Display for Error {
16 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
17 match self {
18
19 }
20 }
21}
22
23
24#[cfg(feature = "std")]
25impl std::error::Error for Error {}