use net::{SocketAddr, Shutdown, Ipv4Addr, Ipv6Addr};
use time::Duration;
use sys::{unsupported, Void};
+use convert::TryFrom;
pub struct TcpStream(Void);
impl TcpStream {
- pub fn connect(_: &SocketAddr) -> io::Result<TcpStream> {
+ pub fn connect(_: io::Result<&SocketAddr>) -> io::Result<TcpStream> {
unsupported()
}
pub struct TcpListener(Void);
impl TcpListener {
- pub fn bind(_: &SocketAddr) -> io::Result<TcpListener> {
+ pub fn bind(_: io::Result<&SocketAddr>) -> io::Result<TcpListener> {
unsupported()
}
pub struct UdpSocket(Void);
impl UdpSocket {
- pub fn bind(_: &SocketAddr) -> io::Result<UdpSocket> {
+ pub fn bind(_: io::Result<&SocketAddr>) -> io::Result<UdpSocket> {
unsupported()
}
match self.0 {}
}
- pub fn connect(&self, _: &SocketAddr) -> io::Result<()> {
+ pub fn connect(&self, _: io::Result<&SocketAddr>) -> io::Result<()> {
match self.0 {}
}
}
pub struct LookupHost(Void);
+impl LookupHost {
+ pub fn port(&self) -> u16 {
+ match self.0 {}
+ }
+}
+
impl Iterator for LookupHost {
type Item = SocketAddr;
fn next(&mut self) -> Option<SocketAddr> {
}
}
-pub fn lookup_host(_: &str) -> io::Result<LookupHost> {
- unsupported()
+impl<'a> TryFrom<&'a str> for LookupHost {
+ type Error = io::Error;
+
+ fn try_from(_v: &'a str) -> io::Result<LookupHost> {
+ unsupported()
+ }
+}
+
+impl<'a> TryFrom<(&'a str, u16)> for LookupHost {
+ type Error = io::Error;
+
+ fn try_from(_v: (&'a str, u16)) -> io::Result<LookupHost> {
+ unsupported()
+ }
}
#[allow(nonstandard_style)]