pub enum ModbusError {
FrameTooShort,
FrameTooLong,
CrcMismatch {
expected: u16,
found: u16,
},
InvalidValueCount,
MalformedResponse,
}Expand description
What can go wrong building or reading a Modbus RTU frame.
Variants§
FrameTooShort
A frame is shorter than the smallest valid RTU ADU (address, function, CRC).
FrameTooLong
A frame or PDU is longer than the 256-byte RTU maximum allows.
CrcMismatch
A received frame’s CRC does not match its contents, so the frame is corrupt.
Fields
InvalidValueCount
A write request named a number of values a single request cannot carry (it must be between one and the function’s maximum).
MalformedResponse
A response PDU is truncated or its declared byte count does not match its data.
Trait Implementations§
Source§impl Clone for ModbusError
impl Clone for ModbusError
Source§fn clone(&self) -> ModbusError
fn clone(&self) -> ModbusError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ModbusError
Source§impl Debug for ModbusError
impl Debug for ModbusError
Source§impl Display for ModbusError
impl Display for ModbusError
impl Eq for ModbusError
Source§impl Error for ModbusError
impl Error for ModbusError
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 ModbusError
impl PartialEq for ModbusError
impl StructuralPartialEq for ModbusError
Auto Trait Implementations§
impl Freeze for ModbusError
impl RefUnwindSafe for ModbusError
impl Send for ModbusError
impl Sync for ModbusError
impl Unpin for ModbusError
impl UnsafeUnpin for ModbusError
impl UnwindSafe for ModbusError
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