From 9e3f3caad06fa89ab8ad25f5260f7512d22e8e00 Mon Sep 17 00:00:00 2001 From: Andy Grover Date: Fri, 24 Feb 2017 12:57:05 -0800 Subject: [PATCH] Implement Debug for PollEvented if E implements Debug Useful, esp since mio::unix::EventedFd already implements Debug. Signed-off-by: Andy Grover --- src/reactor/poll_evented.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/reactor/poll_evented.rs b/src/reactor/poll_evented.rs index 351276462..4737e2bcc 100644 --- a/src/reactor/poll_evented.rs +++ b/src/reactor/poll_evented.rs @@ -6,6 +6,7 @@ //! acquisition of a token, and tracking of the readiness state on the //! underlying I/O primitive. +use std::fmt; use std::io::{self, Read, Write}; use std::sync::atomic::{AtomicUsize, Ordering}; @@ -43,6 +44,12 @@ pub struct PollEvented { io: E, } +impl fmt::Debug for PollEvented { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{{PollEvented {:?}}}", self.io) + } +} + impl PollEvented { /// Creates a new readiness stream associated with the provided /// `loop_handle` and for the given `source`.