Expand description
High-level async Modbus client with automatic retries, timeouts, and throttling.
This crate provides ModbusClient, an ergonomic async client that wraps any
DataLink transport and handles:
- PDU encoding/decoding via
rustmod-core - Configurable response timeouts
- Automatic retries with reconnection on transport errors
- Inter-request throttle delays for slow devices
- Request/response validation (echo checks, payload lengths)
- Optional metrics collection (
metricsfeature)
For synchronous (blocking) usage, see SyncModbusTcpClient.
§Supported function codes
Re-exports§
pub use points::CoilPoints;pub use points::RegisterPoints;pub use sync::SyncClientError;pub use sync::SyncModbusTcpClient;
Modules§
Structs§
- Client
Config - Configuration for a
ModbusClient. - Device
Identification Object - A single object returned in a FC43/0x0E (Read Device Identification) response.
- Modbus
Client - Async Modbus client that wraps a
DataLinktransport. - Read
Device Identification Response - Response from FC43/0x0E (Read Device Identification).
- Report
Server IdResponse - Response from FC17 (Report Server ID).
- UnitId
- A Modbus unit identifier (station address).
Enums§
- Client
Error - Errors that can occur when executing a Modbus request through
ModbusClient. - Invalid
Response Kind - Describes why a Modbus response was considered invalid.
- Retry
Policy - Controls which requests are eligible for automatic retry on transport errors.