pub enum ClientError {
Request(ModbusError),
BroadcastRead,
Port(PortError),
Timeout {
unit: u8,
received: usize,
},
Frame(ModbusError),
WrongUnit {
expected: u8,
found: u8,
},
WrongFunction {
expected: u8,
found: u8,
},
Mismatch {
unit: u8,
},
Exception {
unit: u8,
function: u8,
exception: Exception,
},
}Expand description
Why a transaction failed.
Variants§
Request(ModbusError)
The request could not be built: a quantity outside what one request carries.
BroadcastRead
A read was addressed to the broadcast address, which no device answers.
Port(PortError)
The serial port failed.
Timeout
No complete reply arrived within the response timeout.
Frame(ModbusError)
The reply failed its CRC or is not the shape its function gives.
WrongUnit
A reply came back from a unit other than the one asked.
WrongFunction
A reply answered a function other than the one asked.
Mismatch
A well-formed reply that does not answer the request: a write echoed other values, or a read returned another count.
Exception
The device refused the request.
Trait Implementations§
Source§impl Clone for ClientError
impl Clone for ClientError
Source§fn clone(&self) -> ClientError
fn clone(&self) -> ClientError
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 moreSource§impl Debug for ClientError
impl Debug for ClientError
Source§impl Display for ClientError
impl Display for ClientError
impl Eq for ClientError
Source§impl Error for ClientError
impl Error for ClientError
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 ClientError
impl PartialEq for ClientError
impl StructuralPartialEq for ClientError
Auto Trait Implementations§
impl Freeze for ClientError
impl RefUnwindSafe for ClientError
impl Send for ClientError
impl Sync for ClientError
impl Unpin for ClientError
impl UnsafeUnpin for ClientError
impl UnwindSafe for ClientError
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