pub enum TransportError {
Io(Error),
Frame(FrameError),
Timeout,
Disconnected,
AccessDenied,
TlsHandshake(String),
AuthorizationDenied {
role: Option<String>,
function_code: FunctionCode,
},
}Expand description
Errors that can occur during transport operations.
Variants§
Io(Error)
Underlying I/O error.
Frame(FrameError)
Frame-level error (decode, encode, CRC, protocol ID).
Timeout
Operation timed out.
Disconnected
Connection was closed by the remote peer.
AccessDenied
Connection denied by access control.
TlsHandshake(String)
TLS handshake failure (used by modbus-tls, defined here for TransportError unification).
AuthorizationDenied
Authorization denied by server policy.
Fields
§
function_code: FunctionCodeThe function code that was denied.
Trait Implementations§
Source§impl Debug for TransportError
impl Debug for TransportError
Source§impl Display for TransportError
impl Display for TransportError
Source§impl Error for TransportError
impl Error for TransportError
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 From<Error> for TransportError
impl From<Error> for TransportError
Source§impl From<FrameError> for TransportError
impl From<FrameError> for TransportError
Source§fn from(source: FrameError) -> Self
fn from(source: FrameError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for TransportError
impl !UnwindSafe for TransportError
impl Freeze for TransportError
impl Send for TransportError
impl Sync for TransportError
impl Unpin for TransportError
impl UnsafeUnpin for TransportError
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