mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-09 00:00:08 +02:00
Implement Debug for PollEvented<E> if E implements Debug
Useful, esp since mio::unix::EventedFd already implements Debug. Signed-off-by: Andy Grover <[email protected]>
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
//! acquisition of a token, and tracking of the readiness state on the
|
//! acquisition of a token, and tracking of the readiness state on the
|
||||||
//! underlying I/O primitive.
|
//! underlying I/O primitive.
|
||||||
|
|
||||||
|
use std::fmt;
|
||||||
use std::io::{self, Read, Write};
|
use std::io::{self, Read, Write};
|
||||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||||
|
|
||||||
@@ -43,6 +44,12 @@ pub struct PollEvented<E> {
|
|||||||
io: E,
|
io: E,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<E: mio::Evented + fmt::Debug> fmt::Debug for PollEvented<E> {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
|
write!(f, "{{PollEvented {:?}}}", self.io)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<E: mio::Evented> PollEvented<E> {
|
impl<E: mio::Evented> PollEvented<E> {
|
||||||
/// Creates a new readiness stream associated with the provided
|
/// Creates a new readiness stream associated with the provided
|
||||||
/// `loop_handle` and for the given `source`.
|
/// `loop_handle` and for the given `source`.
|
||||||
|
|||||||
Reference in New Issue
Block a user