pub struct ConnectionParams {
pub host: String,
pub port: u16,
pub use_tls: bool,
pub validate_server_certificate: bool,
pub timeout_ms: u64,
}Expand description
Connection parameters for establishing a transport connection.
Fields§
§host: StringDatabase host
port: u16Database port
use_tls: boolUse TLS/SSL
validate_server_certificate: boolValidate server certificate (default: true)
timeout_ms: u64Connection timeout in milliseconds
Implementations§
Source§impl ConnectionParams
impl ConnectionParams
Sourcepub fn with_validate_server_certificate(self, validate: bool) -> Self
pub fn with_validate_server_certificate(self, validate: bool) -> Self
Set whether to validate the server certificate.
§Security Warning
Disabling certificate validation makes the connection vulnerable to man-in-the-middle attacks. Only disable in development environments with self-signed certificates.
Sourcepub fn with_timeout(self, timeout_ms: u64) -> Self
pub fn with_timeout(self, timeout_ms: u64) -> Self
Set connection timeout.
Sourcepub fn to_websocket_url(&self) -> String
pub fn to_websocket_url(&self) -> String
Build the WebSocket URL from parameters.
Trait Implementations§
Source§impl Clone for ConnectionParams
impl Clone for ConnectionParams
Source§fn clone(&self) -> ConnectionParams
fn clone(&self) -> ConnectionParams
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 moreAuto Trait Implementations§
impl Freeze for ConnectionParams
impl RefUnwindSafe for ConnectionParams
impl Send for ConnectionParams
impl Sync for ConnectionParams
impl Unpin for ConnectionParams
impl UnsafeUnpin for ConnectionParams
impl UnwindSafe for ConnectionParams
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