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>
pub fn connect_with_transport<TRANSPORT>( transport: TRANSPORT, config: ModbusConfig, poll_interval: Duration, ) -> Result<Self, AsyncError>
Creates an async serial client from a caller-provided transport.
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).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AsyncSerialClient
impl RefUnwindSafe for AsyncSerialClient
impl Send for AsyncSerialClient
impl Sync for AsyncSerialClient
impl Unpin for AsyncSerialClient
impl UnsafeUnpin for AsyncSerialClient
impl UnwindSafe for AsyncSerialClient
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