Skip to main content

Crate rustmod_client

Crate rustmod_client 

Source
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 (metrics feature)

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§

points
sync

Structs§

ClientConfig
Configuration for a ModbusClient.
DeviceIdentificationObject
A single object returned in a FC43/0x0E (Read Device Identification) response.
ModbusClient
Async Modbus client that wraps a DataLink transport.
ReadDeviceIdentificationResponse
Response from FC43/0x0E (Read Device Identification).
ReportServerIdResponse
Response from FC17 (Report Server ID).
UnitId
A Modbus unit identifier (station address).

Enums§

ClientError
Errors that can occur when executing a Modbus request through ModbusClient.
InvalidResponseKind
Describes why a Modbus response was considered invalid.
RetryPolicy
Controls which requests are eligible for automatic retry on transport errors.