pub enum ResponsePacketError {
TooShort(usize),
CRCMismatch {
expected: u16,
received: u16,
},
UnexpectedResponder(u8),
InvalidFormat,
}Expand description
Errors that can occur while validating and decoding a Modbus RTU response packet.
Variants§
TooShort(usize)
The response frame is shorter than the minimum Modbus RTU length.
CRCMismatch
Calculated CRC does not match the CRC bytes present in the frame.
UnexpectedResponder(u8)
The response came from a different Modbus slave than the request targeted.
InvalidFormat
The payload failed structural validation (unexpected function code, byte count mismatch, etc.).
Trait Implementations§
Source§impl Clone for ResponsePacketError
impl Clone for ResponsePacketError
Source§fn clone(&self) -> ResponsePacketError
fn clone(&self) -> ResponsePacketError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResponsePacketError
impl Debug for ResponsePacketError
Source§impl Display for ResponsePacketError
impl Display for ResponsePacketError
Source§impl Error for ResponsePacketError
impl Error for ResponsePacketError
1.30.0 · 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 PartialEq for ResponsePacketError
impl PartialEq for ResponsePacketError
impl Copy for ResponsePacketError
impl Eq for ResponsePacketError
impl StructuralPartialEq for ResponsePacketError
Auto Trait Implementations§
impl Freeze for ResponsePacketError
impl RefUnwindSafe for ResponsePacketError
impl Send for ResponsePacketError
impl Sync for ResponsePacketError
impl Unpin for ResponsePacketError
impl UnwindSafe for ResponsePacketError
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