From 9936fefc26192f857f2d4bbdbbc5ec93c6259b93 Mon Sep 17 00:00:00 2001 From: Francisca Ortega Date: Wed, 9 Oct 2024 00:32:35 -0300 Subject: [PATCH] add: new_default function to client tls structure --- src/client/tls_connection.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/client/tls_connection.rs b/src/client/tls_connection.rs index 5f1fc3a8..bdb06a07 100644 --- a/src/client/tls_connection.rs +++ b/src/client/tls_connection.rs @@ -33,16 +33,26 @@ pub struct ClientTLSConnection { server_addr: IpAddr, /// Read time timeout timeout: tokio::time::Duration, + new_default: fn(IpAddr, Duration) -> Self, } #[async_trait] impl ClientConnection for ClientTLSConnection { /// Creates TCPConnection - fn new(server_addr:IpAddr, timeout: Duration) -> Self { + fn new(server_addr:IpAddr, timeout: Duration, new_default: usize) -> Self { ClientTLSConnection { server_addr: server_addr, timeout: timeout, + new_default: ClientTLSConnection::new_default, + } + } + + fn new_default(server_addr:IpAddr, timeout: Duration) -> Self { + ClientTLSConnection { + server_addr: server_addr, + timeout: timeout, + new_default: ClientTLSConnection::new_default, } }