process: Add Debug impls for nondeprecated structs

This commit is contained in:
Ivan Petkov
2019-06-24 16:56:50 -07:00
parent 4d11784b01
commit 914b803429
3 changed files with 49 additions and 1 deletions
+13
View File
@@ -36,6 +36,7 @@ use mio::event::Evented;
use mio;
use self::libc::c_int;
use self::tokio_signal::unix::Signal;
use std::fmt;
use tokio_io::IoFuture;
use tokio_core::reactor::{Handle, PollEvented};
@@ -45,6 +46,17 @@ pub struct Child {
sigchld: FlattenStream<IoFuture<Signal>>,
}
impl fmt::Debug for Child {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_struct("Child")
.field("pid", &self.inner.id())
.field("inner", &self.inner)
.field("reaped", &self.reaped)
.field("sigchld", &"..")
.finish()
}
}
impl Child {
pub fn new(inner: process::Child, handle: &Handle) -> Child {
Child {
@@ -125,6 +137,7 @@ impl Child {
}
}
#[derive(Debug)]
pub struct Fd<T>(T);
impl<T: io::Read> io::Read for Fd<T> {