From 7d6c0e68a19ad5e2e4e05cfc219d446be6ff2286 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Thu, 30 Nov 2023 22:52:53 +0300 Subject: jsonrpc: Enhance the API and add support for TCP, Unix, and TLS protocols. --- net/src/transports/tls.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'net/src/transports/tls.rs') diff --git a/net/src/transports/tls.rs b/net/src/transports/tls.rs index 01bb5aa..cbb3d99 100644 --- a/net/src/transports/tls.rs +++ b/net/src/transports/tls.rs @@ -138,3 +138,15 @@ pub async fn listen( .await .map(|l| Box::new(l) as Box) } + +impl From> for Box { + fn from(conn: TlsStream) -> Self { + Box::new(TlsConn::new(conn.get_ref().0.clone(), conn)) + } +} + +impl From for Box { + fn from(listener: TlsListener) -> Self { + Box::new(listener) + } +} -- cgit v1.2.3