pub enum ModbusError {
ShortResponse(usize),
BadSlave(u8),
BadHeader,
BadCrc,
Exception(u8),
}Expand description
Protocol-layer error: a frame was received but failed validation.
Variants§
ShortResponse(usize)
Response was shorter than the smallest valid frame for the expected reply.
BadSlave(u8)
Slave address byte didn’t match the request.
BadHeader
Function-code, byte-count, address, or quantity field didn’t match what was expected.
BadCrc
CRC-16 mismatch.
Exception(u8)
Slave returned a Modbus exception. The byte is the exception
code (0x01–0x0B per the spec).
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 · 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 ModbusError
impl Debug for ModbusError
Source§impl Display for ModbusError
impl Display 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 Format for ModbusError
impl Format for ModbusError
Source§impl From<ModbusError> for RtuError
impl From<ModbusError> for RtuError
Source§fn from(e: ModbusError) -> Self
fn from(e: ModbusError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ModbusError
impl PartialEq for ModbusError
impl Copy for ModbusError
impl Eq 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