@@ -56,15 +56,13 @@ pub mod std {
56
56
/// All of these panic when called
57
57
// TODO: Move to `edge-nal`
58
58
pub mod noop {
59
- use core:: {
60
- convert:: Infallible ,
61
- net:: { Ipv4Addr , SocketAddr } ,
62
- } ;
59
+ use core:: convert:: Infallible ;
60
+ use core:: net:: { IpAddr , Ipv4Addr , SocketAddr } ;
63
61
64
62
use edge_nal:: io:: { ErrorType , Read , Write } ;
65
63
use edge_nal:: {
66
- Close , MulticastV4 , MulticastV6 , Readable , TcpAccept , TcpBind , TcpConnect , TcpShutdown ,
67
- TcpSplit , UdpBind , UdpConnect , UdpReceive , UdpSend , UdpSplit ,
64
+ AddrType , Close , Dns , MulticastV4 , MulticastV6 , Readable , TcpAccept , TcpBind , TcpConnect ,
65
+ TcpShutdown , TcpSplit , UdpBind , UdpConnect , UdpReceive , UdpSend , UdpSplit ,
68
66
} ;
69
67
70
68
/// A type that implements all `edge-nal` traits but does not support any operation
@@ -140,6 +138,26 @@ pub mod noop {
140
138
}
141
139
}
142
140
141
+ impl Dns for NoopNet {
142
+ type Error = Infallible ;
143
+
144
+ async fn get_host_by_name (
145
+ & self ,
146
+ _host : & str ,
147
+ _addr_type : AddrType ,
148
+ ) -> Result < IpAddr , Self :: Error > {
149
+ panic ! ( "DNS get_host_by_name not supported" )
150
+ }
151
+
152
+ async fn get_host_by_address (
153
+ & self ,
154
+ _addr : IpAddr ,
155
+ _result : & mut [ u8 ] ,
156
+ ) -> Result < usize , Self :: Error > {
157
+ panic ! ( "DNS get_host_by_address not supported" )
158
+ }
159
+ }
160
+
143
161
impl ErrorType for NoopNet {
144
162
type Error = Infallible ;
145
163
}
0 commit comments