From 2d5eabdeed06ea1c88d88dff464929616710ee9a Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Tue, 11 Dec 2018 14:22:53 -0800 Subject: [PATCH] feat(server): add `server::conn::AddrIncoming::bind` constructor --- src/server/tcp.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/server/tcp.rs b/src/server/tcp.rs index 1538986648..4961311eba 100644 --- a/src/server/tcp.rs +++ b/src/server/tcp.rs @@ -48,6 +48,11 @@ impl AddrIncoming { }) } + /// Creates a new `AddrIncoming` binding to provided socket address. + pub fn bind(addr: &SocketAddr) -> ::Result { + AddrIncoming::new(addr, None) + } + /// Get the local address bound to this listener. pub fn local_addr(&self) -> SocketAddr { self.addr