#[non_exhaustive]pub enum IotError {
NotConnected,
ConnectionFailed(SmolStr),
AuthFailed(SmolStr),
Timeout,
PathNotBound(PropertyPath),
PathKindMismatch {
path: PropertyPath,
expected: &'static str,
},
Codec(CodecError),
Transport(TransportError),
Protocol(SmolStr),
}Expand description
Top-level error every public API in the SDK returns.
Protocol-specific variants are intentionally not enumerated here — they
live in their own crates and are wrapped via the protocol crate’s own
error type (which itself wraps CodecError / TransportError for the
shared sub-failures). The conversion from a protocol-specific error to
IotError happens at the boundary between the protocol crate and the
gateway / IotClient layer.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NotConnected
Operation requested while the client is not connected.
ConnectionFailed(SmolStr)
Connection establishment failed.
AuthFailed(SmolStr)
Authentication failed (bad credentials, expired cert, …).
Timeout
Operation timed out (any layer).
PathNotBound(PropertyPath)
The target PropertyPath is not in the active mapping.
PathKindMismatch
The path is bound but the binding kind does not match the protocol (e.g. asking the MQTT client to handle a Modbus binding).
Fields
path: PropertyPathThe path that triggered the mismatch.
Codec(CodecError)
Codec error shared with the protocol layer.
Transport(TransportError)
Transport error shared with the protocol layer.
Protocol(SmolStr)
Catch-all for protocol-specific failures.
Trait Implementations§
Source§impl Error for IotError
impl Error for IotError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()