We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 247e8d4 + 9087636 commit 091ec88Copy full SHA for 091ec88
src/wire/ip.rs
@@ -214,6 +214,19 @@ impl From<::std::net::IpAddr> for Address {
214
}
215
216
217
+#[cfg(feature = "std")]
218
+impl From<Address> for ::std::net::IpAddr {
219
+ fn from(x: Address) -> ::std::net::IpAddr {
220
+ match x {
221
+ #[cfg(feature = "proto-ipv4")]
222
+ Address::Ipv4(ipv4) => ::std::net::IpAddr::V4(ipv4.into()),
223
+ #[cfg(feature = "proto-ipv6")]
224
+ Address::Ipv6(ipv6) => ::std::net::IpAddr::V6(ipv6.into()),
225
+ _ => unreachable!(),
226
+ }
227
228
+}
229
+
230
#[cfg(all(feature = "std", feature = "proto-ipv4"))]
231
impl From<::std::net::Ipv4Addr> for Address {
232
fn from(ipv4: ::std::net::Ipv4Addr) -> Address {
0 commit comments