summaryrefslogtreecommitdiffstats
path: root/tokio/src/io/driver/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tokio/src/io/driver/mod.rs')
-rw-r--r--tokio/src/io/driver/mod.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/tokio/src/io/driver/mod.rs b/tokio/src/io/driver/mod.rs
index a7d4b7b8..c494db41 100644
--- a/tokio/src/io/driver/mod.rs
+++ b/tokio/src/io/driver/mod.rs
@@ -1,10 +1,16 @@
#![cfg_attr(not(feature = "rt"), allow(dead_code))]
+mod interest;
+pub(crate) use interest::Interest;
+
mod ready;
use ready::Ready;
+mod registration;
+pub(crate) use registration::Registration;
+
mod scheduled_io;
-pub(crate) use scheduled_io::ScheduledIo; // pub(crate) for tests
+use scheduled_io::ScheduledIo;
use crate::park::{Park, Unpark};
use crate::util::slab::{self, Slab};
@@ -68,7 +74,7 @@ pub(super) struct Inner {
}
#[derive(Debug, Eq, PartialEq, Clone, Copy)]
-pub(super) enum Direction {
+enum Direction {
Read,
Write,
}
@@ -313,7 +319,7 @@ impl Inner {
pub(super) fn add_source(
&self,
source: &mut impl mio::event::Source,
- interest: mio::Interest,
+ interest: Interest,
) -> io::Result<slab::Ref<ScheduledIo>> {
let (address, shared) = self.io_dispatch.allocate().ok_or_else(|| {
io::Error::new(
@@ -325,7 +331,7 @@ impl Inner {
let token = GENERATION.pack(shared.generation(), ADDRESS.pack(address.as_usize(), 0));
self.registry
- .register(source, mio::Token(token), interest)?;
+ .register(source, mio::Token(token), interest.to_mio())?;
Ok(shared)
}