pub struct RtuServerConfig {
pub transport: TransportConfig,
pub unit_ids: Vec<u8>,
pub broadcast_enabled: bool,
pub request_timeout: Duration,
pub shutdown_timeout: Duration,
pub simulate_response_delay: bool,
pub additional_response_delay: Duration,
}Expand description
RTU server configuration.
Fields§
§transport: TransportConfigTransport configuration.
unit_ids: Vec<u8>Supported unit IDs (empty = all).
broadcast_enabled: boolEnable broadcast (unit ID 0).
request_timeout: DurationRequest processing timeout.
shutdown_timeout: DurationShutdown timeout.
simulate_response_delay: boolEnable response delay simulation.
additional_response_delay: DurationAdditional response delay (beyond transmission time).
Implementations§
Source§impl RtuServerConfig
impl RtuServerConfig
Sourcepub fn with_transport(self, transport: TransportConfig) -> Self
pub fn with_transport(self, transport: TransportConfig) -> Self
Set transport configuration.
Sourcepub fn with_unit_ids(self, ids: Vec<u8>) -> Self
pub fn with_unit_ids(self, ids: Vec<u8>) -> Self
Set supported unit IDs.
Sourcepub fn with_broadcast(self, enabled: bool) -> Self
pub fn with_broadcast(self, enabled: bool) -> Self
Enable or disable broadcast support.
Sourcepub fn with_request_timeout(self, timeout: Duration) -> Self
pub fn with_request_timeout(self, timeout: Duration) -> Self
Set request timeout.
Sourcepub fn with_response_delay_simulation(self, enabled: bool) -> Self
pub fn with_response_delay_simulation(self, enabled: bool) -> Self
Enable response delay simulation.
Sourcepub fn for_testing() -> Self
pub fn for_testing() -> Self
Create a configuration for testing with channel transport.
Trait Implementations§
Source§impl Clone for RtuServerConfig
impl Clone for RtuServerConfig
Source§fn clone(&self) -> RtuServerConfig
fn clone(&self) -> RtuServerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RtuServerConfig
impl Debug for RtuServerConfig
Source§impl Default for RtuServerConfig
impl Default for RtuServerConfig
Source§impl<'de> Deserialize<'de> for RtuServerConfig
impl<'de> Deserialize<'de> for RtuServerConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RtuServerConfig
impl RefUnwindSafe for RtuServerConfig
impl Send for RtuServerConfig
impl Sync for RtuServerConfig
impl Unpin for RtuServerConfig
impl UnsafeUnpin for RtuServerConfig
impl UnwindSafe for RtuServerConfig
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