File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -446,6 +446,20 @@ impl FromInner<c::sockaddr_in6> for SocketAddrV6 {
446446 }
447447}
448448
449+ #[ stable( feature = "ip_from_ip" , since = "1.16.0" ) ]
450+ impl From < SocketAddrV4 > for SocketAddr {
451+ fn from ( sock4 : SocketAddrV4 ) -> SocketAddr {
452+ SocketAddr :: V4 ( sock4)
453+ }
454+ }
455+
456+ #[ stable( feature = "ip_from_ip" , since = "1.16.0" ) ]
457+ impl From < SocketAddrV6 > for SocketAddr {
458+ fn from ( sock6 : SocketAddrV6 ) -> SocketAddr {
459+ SocketAddr :: V6 ( sock6)
460+ }
461+ }
462+
449463impl < ' a > IntoInner < ( * const c:: sockaddr , c:: socklen_t ) > for & ' a SocketAddr {
450464 fn into_inner ( self ) -> ( * const c:: sockaddr , c:: socklen_t ) {
451465 match * self {
Original file line number Diff line number Diff line change @@ -524,12 +524,14 @@ impl fmt::Display for IpAddr {
524524 }
525525}
526526
527+ #[ stable( feature = "ip_from_ip" , since = "1.16.0" ) ]
527528impl From < Ipv4Addr > for IpAddr {
528529 fn from ( ipv4 : Ipv4Addr ) -> IpAddr {
529530 IpAddr :: V4 ( ipv4)
530531 }
531532}
532533
534+ #[ stable( feature = "ip_from_ip" , since = "1.16.0" ) ]
533535impl From < Ipv6Addr > for IpAddr {
534536 fn from ( ipv6 : Ipv6Addr ) -> IpAddr {
535537 IpAddr :: V6 ( ipv6)
You can’t perform that action at this time.
0 commit comments