diff --git a/src/reactor/mod.rs b/src/reactor/mod.rs index afa4daeb7..23d93bc45 100644 --- a/src/reactor/mod.rs +++ b/src/reactor/mod.rs @@ -6,6 +6,7 @@ use std::cell::RefCell; use std::cmp; +use std::fmt; use std::io::{self, ErrorKind}; use std::mem; use std::rc::{Rc, Weak}; @@ -436,6 +437,14 @@ impl Core { } } +impl fmt::Debug for Core { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("Core") + .field("id", &self.id()) + .finish() + } +} + impl Inner { fn add_source(&mut self, source: &mio::Evented) -> io::Result<(Arc, usize)> { @@ -635,6 +644,14 @@ impl Remote { } } +impl fmt::Debug for Remote { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("Remote") + .field("id", &self.id()) + .finish() + } +} + impl Handle { /// Returns a reference to the underlying remote handle to the event loop. pub fn remote(&self) -> &Remote { @@ -671,6 +688,14 @@ impl Handle { } } +impl fmt::Debug for Handle { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("Handle") + .field("id", &self.id()) + .finish() + } +} + impl TimeoutState { fn block(&mut self, handle: Task) -> Option { match *self {