summaryrefslogtreecommitdiffstats
path: root/tokio/src/process
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2020-10-02 13:54:00 -0700
committerGitHub <noreply@github.com>2020-10-02 13:54:00 -0700
commit1e585ccb516c8dc7c13cbc3d50f8ca49260b9617 (patch)
tree00959b4ac82e4972314baa043cdbca2f2ebf5848 /tokio/src/process
parent7ec6d88b21ea3e5531176f526a51dae0a4513025 (diff)
io: update to Mio 0.7 (#2893)
This also makes Mio an implementation detail, removing it from the public API. This is based on #1767.
Diffstat (limited to 'tokio/src/process')
-rw-r--r--tokio/src/process/unix/mod.rs33
-rw-r--r--tokio/src/process/windows.rs2
2 files changed, 16 insertions, 19 deletions
diff --git a/tokio/src/process/unix/mod.rs b/tokio/src/process/unix/mod.rs
index a8df74a3..46f1d790 100644
--- a/tokio/src/process/unix/mod.rs
+++ b/tokio/src/process/unix/mod.rs
@@ -32,9 +32,8 @@ use crate::process::kill::Kill;
use crate::process::SpawnedChild;
use crate::signal::unix::{signal, Signal, SignalKind};
-use mio::event::Evented;
-use mio::unix::{EventedFd, UnixReady};
-use mio::{Poll as MioPoll, PollOpt, Ready, Token};
+use mio::event::Source;
+use mio::unix::SourceFd;
use std::fmt;
use std::future::Future;
use std::io;
@@ -173,32 +172,30 @@ where
}
}
-impl<T> Evented for Fd<T>
+impl<T> Source for Fd<T>
where
T: AsRawFd,
{
fn register(
- &self,
- poll: &MioPoll,
- token: Token,
- interest: Ready,
- opts: PollOpt,
+ &mut self,
+ registry: &mio::Registry,
+ token: mio::Token,
+ interest: mio::Interest,
) -> io::Result<()> {
- EventedFd(&self.as_raw_fd()).register(poll, token, interest | UnixReady::hup(), opts)
+ SourceFd(&self.as_raw_fd()).register(registry, token, interest)
}
fn reregister(
- &self,
- poll: &MioPoll,
- token: Token,
- interest: Ready,
- opts: PollOpt,
+ &mut self,
+ registry: &mio::Registry,
+ token: mio::Token,
+ interest: mio::Interest,
) -> io::Result<()> {
- EventedFd(&self.as_raw_fd()).reregister(poll, token, interest | UnixReady::hup(), opts)
+ SourceFd(&self.as_raw_fd()).reregister(registry, token, interest)
}
- fn deregister(&self, poll: &MioPoll) -> io::Result<()> {
- EventedFd(&self.as_raw_fd()).deregister(poll)
+ fn deregister(&mut self, registry: &mio::Registry) -> io::Result<()> {
+ SourceFd(&self.as_raw_fd()).deregister(registry)
}
}
diff --git a/tokio/src/process/windows.rs b/tokio/src/process/windows.rs
index 1fbdee21..1aa6c890 100644
--- a/tokio/src/process/windows.rs
+++ b/tokio/src/process/windows.rs
@@ -20,7 +20,7 @@ use crate::process::kill::Kill;
use crate::process::SpawnedChild;
use crate::sync::oneshot;
-use mio_named_pipes::NamedPipe;
+use mio::windows::NamedPipe;
use std::fmt;
use std::future::Future;
use std::io;