aboutsummaryrefslogtreecommitdiff
path: root/net/src/connection.rs
diff options
context:
space:
mode:
Diffstat (limited to 'net/src/connection.rs')
-rw-r--r--net/src/connection.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/src/connection.rs b/net/src/connection.rs
index b1d7550..3c047a0 100644
--- a/net/src/connection.rs
+++ b/net/src/connection.rs
@@ -8,6 +8,11 @@ use crate::{
/// Alias for `Box<dyn Connection>`
pub type Conn = Box<dyn Connection>;
+/// A trait for objects which can be converted to [`Conn`].
+pub trait ToConn {
+ fn to_conn(self) -> Conn;
+}
+
/// Connection is a generic network connection interface for
/// [`udp::UdpConn`], [`tcp::TcpConn`], and [`unix::UnixConn`].
///