diff options
Diffstat (limited to 'net/src/transports/unix.rs')
-rw-r--r-- | net/src/transports/unix.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/src/transports/unix.rs b/net/src/transports/unix.rs index e504934..0698975 100644 --- a/net/src/transports/unix.rs +++ b/net/src/transports/unix.rs @@ -74,3 +74,15 @@ pub fn listen_unix(path: &String) -> Result<UnixListener> { let listener = UnixListener::bind(path)?; Ok(listener) } + +impl From<UnixStream> for Box<dyn Connection> { + fn from(conn: UnixStream) -> Self { + Box::new(UnixConn::new(conn)) + } +} + +impl From<UnixListener> for Box<dyn Listener> { + fn from(listener: UnixListener) -> Self { + Box::new(listener) + } +} |