Could not find `net` in `mio`(0.7.0)

this error is when I use mio(0.7.0)
so I think maybe wrong is me?I have see the examples of mio,
the way import "TcpListener, TcpStream" is same as me.

use mio::net::{TcpListener, TcpStream};

and I can find "net" in mio project directory,
and the lib.rs about the mod is:

#[macro_use]
mod macros;

mod interest;
mod poll;
mod sys;
mod token;
mod waker;

pub mod event;

cfg_net! {
    mod io_source;

    pub mod net;
}

so why could not find "net" module?and how to import TcpListener and TcpStream?

According to the document, the module is gated under some features. So replace this line under your Cargo.toml:

mio = "0.7"

with this

mio = { version = "0.7", features = ["tcp"] }
1 Like

oh~it's fix!it's work,thanks for help!