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+
13use std:: collections:: HashMap ;
24use std:: os:: unix:: io:: { AsRawFd , RawFd } ;
35
@@ -11,6 +13,7 @@ fn errno() -> i32 {
1113 unsafe { * libc:: __errno_location ( ) }
1214}
1315
16+ #[ derive( Debug ) ]
1417pub struct BufferedEventManager {
1518 event_manager : EventManager ,
1619 // TODO The length is always unused, a custom type could thus save `size_of::<usize>()` bytes.
@@ -91,6 +94,22 @@ pub struct EventManager {
9194 events : HashMap < RawFd , Action > ,
9295}
9396
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+
94113impl EventManager {
95114 /// Add an entry to the interest list of the epoll file descriptor.
96115 ///
You can’t perform that action at this time.
0 commit comments