pub struct ModbusSerialConfig<const PORT_PATH_LEN: usize = 64> {
pub port_path: String<PORT_PATH_LEN>,
pub mode: SerialMode,
pub baud_rate: BaudRate,
pub data_bits: DataBits,
pub stop_bits: u8,
pub parity: Parity,
pub response_timeout_ms: u32,
pub retry_attempts: u8,
pub retry_backoff_strategy: BackoffStrategy,
pub retry_jitter_strategy: JitterStrategy,
pub retry_random_fn: Option<RetryRandomFn>,
}Expand description
Configuration parameters for establishing a Modbus Serial connection.
Fields§
§port_path: String<PORT_PATH_LEN>The path to the serial port (e.g., “/dev/ttyUSB0” or “COM1”).
mode: SerialModeThe serial mode to use (RTU or ASCII).
baud_rate: BaudRateCommunication speed in bits per second (e.g., 9600, 115200).
data_bits: DataBitsNumber of data bits per character (typically DataBits::Eight for RTU, DataBits::Seven for ASCII).
stop_bits: u8Number of stop bits (This will be recalculated before calling the transport layer).
parity: ParityThe parity checking mode.
response_timeout_ms: u32Timeout for waiting for a response in milliseconds.
retry_attempts: u8Number of retries for failed operations.
retry_backoff_strategy: BackoffStrategyBackoff strategy used when scheduling retries.
retry_jitter_strategy: JitterStrategyOptional jitter strategy applied on top of retry backoff delay.
retry_random_fn: Option<RetryRandomFn>Optional application-provided random callback used by jitter.
Trait Implementations§
Auto Trait Implementations§
impl<const PORT_PATH_LEN: usize> Freeze for ModbusSerialConfig<PORT_PATH_LEN>
impl<const PORT_PATH_LEN: usize> RefUnwindSafe for ModbusSerialConfig<PORT_PATH_LEN>
impl<const PORT_PATH_LEN: usize> Send for ModbusSerialConfig<PORT_PATH_LEN>
impl<const PORT_PATH_LEN: usize> Sync for ModbusSerialConfig<PORT_PATH_LEN>
impl<const PORT_PATH_LEN: usize> Unpin for ModbusSerialConfig<PORT_PATH_LEN>
impl<const PORT_PATH_LEN: usize> UnsafeUnpin for ModbusSerialConfig<PORT_PATH_LEN>
impl<const PORT_PATH_LEN: usize> UnwindSafe for ModbusSerialConfig<PORT_PATH_LEN>
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