File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change
1
+ #![ warn( missing_debug_implementations) ]
2
+
1
3
use std:: collections:: HashMap ;
2
4
use std:: os:: unix:: io:: { AsRawFd , RawFd } ;
3
5
@@ -11,6 +13,7 @@ fn errno() -> i32 {
11
13
unsafe { * libc:: __errno_location ( ) }
12
14
}
13
15
16
+ #[ derive( Debug ) ]
14
17
pub struct BufferedEventManager {
15
18
event_manager : EventManager ,
16
19
// TODO The length is always unused, a custom type could thus save `size_of::<usize>()` bytes.
@@ -91,6 +94,22 @@ pub struct EventManager {
91
94
events : HashMap < RawFd , Action > ,
92
95
}
93
96
97
+ impl std:: fmt:: Debug for EventManager {
98
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
99
+ f. debug_struct ( "EventManager" )
100
+ . field ( "epfd" , & self . epfd )
101
+ . field (
102
+ "events" ,
103
+ & self
104
+ . events
105
+ . iter ( )
106
+ . map ( |( k, v) | ( * k, v as * const _ as usize ) )
107
+ . collect :: < HashMap < _ , _ > > ( ) ,
108
+ )
109
+ . finish ( )
110
+ }
111
+ }
112
+
94
113
impl EventManager {
95
114
/// Add an entry to the interest list of the epoll file descriptor.
96
115
///
You can’t perform that action at this time.
0 commit comments