feat(server): add server::conn::AddrIncoming::bind constructor

This commit is contained in:
Sean McArthur
2018-12-11 14:22:53 -08:00
parent 3287a0cdab
commit 2d5eabdeed

View File

@@ -48,6 +48,11 @@ impl AddrIncoming {
}) })
} }
/// Creates a new `AddrIncoming` binding to provided socket address.
pub fn bind(addr: &SocketAddr) -> ::Result<Self> {
AddrIncoming::new(addr, None)
}
/// Get the local address bound to this listener. /// Get the local address bound to this listener.
pub fn local_addr(&self) -> SocketAddr { pub fn local_addr(&self) -> SocketAddr {
self.addr self.addr