pub struct ClientBuilder<S, TX, D = NoDelay> { /* private fields */ }Expand description
Builder for Client. Obtain via Client::builder().
Uses the same typestate pattern as BridgeBuilder.
S and TX start as () until .rtu() is called. D starts as
NoDelay and can be upgraded with .delay().
Implementations§
Source§impl ClientBuilder<(), (), NoDelay>
impl ClientBuilder<(), (), NoDelay>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new ClientBuilder with no serial port configured.
Prefer Client::builder() over calling this directly.
Source§impl<D> ClientBuilder<(), (), D>
impl<D> ClientBuilder<(), (), D>
Sourcepub fn rtu<S, TX>(self, serial: S, tx_en: TX) -> ClientBuilder<S, TX, D>
pub fn rtu<S, TX>(self, serial: S, tx_en: TX) -> ClientBuilder<S, TX, D>
Sourcepub fn rtu_no_pin<S>(self, serial: S) -> ClientBuilder<S, NoPin, D>
pub fn rtu_no_pin<S>(self, serial: S) -> ClientBuilder<S, NoPin, D>
Source§impl<S, TX, D> ClientBuilder<S, TX, D>
impl<S, TX, D> ClientBuilder<S, TX, D>
Sourcepub fn rtu_timeout(self, ms: u32) -> Self
pub fn rtu_timeout(self, ms: u32) -> Self
Sets the RTU I/O timeout in milliseconds.
Applied while waiting for an incoming RTU request from the serial master.
Requires a delay provider — call .delay() as well.
Sourcepub fn tcp_timeout(self, ms: u32) -> Self
pub fn tcp_timeout(self, ms: u32) -> Self
Sets the TCP I/O timeout in milliseconds.
Applied while waiting for the upstream TCP server response.
Requires a delay provider — call .delay() as well.
Source§impl<S, TX> ClientBuilder<S, TX, NoDelay>
impl<S, TX> ClientBuilder<S, TX, NoDelay>
Sourcepub fn delay<D2>(self, delay: D2) -> ClientBuilder<S, TX, D2>
pub fn delay<D2>(self, delay: D2) -> ClientBuilder<S, TX, D2>
Trait Implementations§
Auto Trait Implementations§
impl<S, TX, D> Freeze for ClientBuilder<S, TX, D>
impl<S, TX, D> RefUnwindSafe for ClientBuilder<S, TX, D>
impl<S, TX, D> Send for ClientBuilder<S, TX, D>
impl<S, TX, D> Sync for ClientBuilder<S, TX, D>
impl<S, TX, D> Unpin for ClientBuilder<S, TX, D>
impl<S, TX, D> UnsafeUnpin for ClientBuilder<S, TX, D>
impl<S, TX, D> UnwindSafe for ClientBuilder<S, TX, D>
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