pub struct AsyncSerialClient { /* private fields */ }Expand description
Async Modbus serial client facade.
Supports both RTU and ASCII framing. All Modbus request methods
(read_holding_registers, write_single_coil, etc.) are available directly
on this type via Deref to [AsyncClientCore].
Implementations§
Source§impl AsyncSerialClient
impl AsyncSerialClient
Sourcepub fn connect_with_transport<TRANSPORT>(
transport: TRANSPORT,
config: ModbusConfig,
poll_interval: Duration,
) -> Result<Self, AsyncError>
👎Deprecated: use AsyncSerialClient::new_with_transport(…) and then client.connect().await
pub fn connect_with_transport<TRANSPORT>( transport: TRANSPORT, config: ModbusConfig, poll_interval: Duration, ) -> Result<Self, AsyncError>
use AsyncSerialClient::new_with_transport(…) and then client.connect().await
Deprecated constructor alias.
Use AsyncSerialClient::new_with_transport and then call
client.connect().await?.
Sourcepub fn new_with_transport<TRANSPORT>(
transport: TRANSPORT,
config: ModbusConfig,
poll_interval: Duration,
) -> Result<Self, AsyncError>
pub fn new_with_transport<TRANSPORT>( transport: TRANSPORT, config: ModbusConfig, poll_interval: Duration, ) -> Result<Self, AsyncError>
Creates an async serial client from a caller-provided transport without connecting.
This is the escape hatch for custom serial drivers and integration tests
that inject a mock transport. The config must be
ModbusConfig::Serial(_) or the call returns
AsyncError::Mbus(MbusError::InvalidTransport). Call
[AsyncClientCore::connect] on the returned client before sending
requests.