@@ -363,6 +363,12 @@ impl fmt::Display for InetAddr {
363
363
}
364
364
}
365
365
366
+ impl fmt:: Debug for InetAddr {
367
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
368
+ fmt:: Display :: fmt ( self , f)
369
+ }
370
+ }
371
+
366
372
/*
367
373
*
368
374
* ===== IpAddr =====
@@ -415,6 +421,12 @@ impl fmt::Display for IpAddr {
415
421
}
416
422
}
417
423
424
+ impl fmt:: Debug for IpAddr {
425
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
426
+ fmt:: Display :: fmt ( self , f)
427
+ }
428
+ }
429
+
418
430
/*
419
431
*
420
432
* ===== Ipv4Addr =====
@@ -482,6 +494,12 @@ impl fmt::Display for Ipv4Addr {
482
494
}
483
495
}
484
496
497
+ impl fmt:: Debug for Ipv4Addr {
498
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
499
+ fmt:: Display :: fmt ( self , f)
500
+ }
501
+ }
502
+
485
503
/*
486
504
*
487
505
* ===== Ipv6Addr =====
@@ -536,6 +554,12 @@ impl fmt::Display for Ipv6Addr {
536
554
}
537
555
}
538
556
557
+ impl fmt:: Debug for Ipv6Addr {
558
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
559
+ fmt:: Display :: fmt ( self , f)
560
+ }
561
+ }
562
+
539
563
/*
540
564
*
541
565
* ===== UnixAddr =====
@@ -676,14 +700,20 @@ impl fmt::Display for UnixAddr {
676
700
}
677
701
}
678
702
703
+ impl fmt:: Debug for UnixAddr {
704
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
705
+ fmt:: Display :: fmt ( self , f)
706
+ }
707
+ }
708
+
679
709
/*
680
710
*
681
711
* ===== Sock addr =====
682
712
*
683
713
*/
684
714
685
715
/// Represents a socket address
686
- #[ derive( Copy ) ]
716
+ #[ derive( Copy , Debug ) ]
687
717
pub enum SockAddr {
688
718
Inet ( InetAddr ) ,
689
719
Unix ( UnixAddr ) ,
@@ -875,6 +905,12 @@ pub mod netlink {
875
905
write ! ( f, "pid: {} groups: {}" , self . pid( ) , self . groups( ) )
876
906
}
877
907
}
908
+
909
+ impl fmt:: Debug for NetlinkAddr {
910
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
911
+ fmt:: Display :: fmt ( self , f)
912
+ }
913
+ }
878
914
}
879
915
880
916
#[ cfg( any( target_os = "ios" , target_os = "macos" ) ) ]
@@ -973,4 +1009,10 @@ pub mod sys_control {
973
1009
write ! ( f, "id: {} unit: {}" , self . id( ) , self . unit( ) )
974
1010
}
975
1011
}
1012
+
1013
+ impl fmt:: Debug for SysControlAddr {
1014
+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
1015
+ fmt:: Display :: fmt ( self , f)
1016
+ }
1017
+ }
976
1018
}
0 commit comments