From 5111a3d5749625c3d8e26a24a5a32c4da58f18d3 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Thu, 30 Nov 2023 23:51:18 +0300 Subject: net: Use ToConn and ToListener traits for objects that can be converted to Conn and Listener. --- net/src/listener.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'net/src/listener.rs') diff --git a/net/src/listener.rs b/net/src/listener.rs index fcd1175..cab5330 100644 --- a/net/src/listener.rs +++ b/net/src/listener.rs @@ -8,6 +8,11 @@ use crate::{ /// Alias for `Box` pub type Listener = Box; +/// A trait for objects which can be converted to [`Listener`]. +pub trait ToListener { + fn to_listener(self) -> Listener; +} + /// ConnListener is a generic network listener. #[async_trait] pub trait ConnListener: Send + Sync { -- cgit v1.2.3