Skip to main content

motorcortex_rust/connection/
connection_options.rs

1#[derive(Clone)]
2/// Options used to configure the connection settings.
3pub struct ConnectionOptions {
4    /// Path to the TLS certificate used for secure communication.
5    pub certificate: String,
6    /// Connection timeout in milliseconds.
7    pub conn_timeout_ms: u32,
8    /// I/O timeout in milliseconds.
9    pub io_timeout_ms: u32,
10}
11
12impl ConnectionOptions {
13    /// Creates a new `ConnectionOptions` instance.
14    ///
15    /// # Arguments:
16    /// * `certificate` - Path to the TLS certificate.
17    /// * `conn_timeout_ms` - Timeout value for connection establishment, in milliseconds.
18    /// * `io_timeout_ms` - Timeout value for I/O operations, in milliseconds.
19    pub fn new(certificate: String, conn_timeout_ms: u32, io_timeout_ms: u32) -> Self {
20        Self {
21            certificate,
22            conn_timeout_ms,
23            io_timeout_ms,
24        }
25    }
26}