From 1e585ccb516c8dc7c13cbc3d50f8ca49260b9617 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Fri, 2 Oct 2020 13:54:00 -0700 Subject: 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. --- tokio/src/process/unix/mod.rs | 33 +++++++++++++++------------------ tokio/src/process/windows.rs | 2 +- 2 files changed, 16 insertions(+), 19 deletions(-) (limited to 'tokio/src/process') 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 Evented for Fd +impl Source for Fd 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; -- cgit v1.2.3