1[package]
2edition = "2021"
3rust-version = "1.70"
4name = "mio"
5# When releasing to crates.io:
6# - Update CHANGELOG.md.
7# - Create git tag
8version = "1.0.3"
9license = "MIT"
10authors = [
11 "Carl Lerche <me@carllerche.com>",
12 "Thomas de Zeeuw <thomasdezeeuw@gmail.com>",
13 "Tokio Contributors <team@tokio.rs>",
14]
15description = "Lightweight non-blocking I/O."
16homepage = "https://github.com/tokio-rs/mio"
17repository = "https://github.com/tokio-rs/mio"
18readme = "README.md"
19keywords = ["io", "async", "non-blocking"]
20categories = ["asynchronous"]
21include = [
22 "Cargo.toml",
23 "LICENSE",
24 "README.md",
25 "CHANGELOG.md",
26 "src/**/*.rs",
27 "examples/**/*.rs",
28]
29
30# For documentation of features see the `mio::features` module.
31[features]
32# By default Mio only provides a shell implementation.
33default = ["log"]
34
35# Enables the `Poll` and `Registry` types.
36os-poll = []
37# Enables additional OS specific extensions, e.g. Unix `pipe(2)`.
38os-ext = [
39 "os-poll",
40 "windows-sys/Win32_System_Pipes",
41 "windows-sys/Win32_Security",
42]
43# Enables `mio::net` module containing networking primitives.
44net = []
45
46[dependencies]
47log = { version = "0.4.8", optional = true }
48
49[target.'cfg(unix)'.dependencies]
50libc = "0.2.159"
51
52[target.'cfg(target_os = "hermit")'.dependencies]
53libc = "0.2.159"
54
55[target.'cfg(windows)'.dependencies.windows-sys]
56version = "0.52"
57features = [
58 "Wdk_Foundation", # Required for AFD.
59 "Wdk_Storage_FileSystem", # Required for AFD.
60 "Wdk_System_IO", # Required for AFD.
61 "Win32_Foundation", # Basic types eg HANDLE
62 "Win32_Networking_WinSock", # winsock2 types/functions
63 "Win32_Storage_FileSystem", # Enables NtCreateFile
64 "Win32_System_IO", # IO types like OVERLAPPED etc
65 "Win32_System_WindowsProgramming", # General future used for various types/funcs
66]
67
68[target.'cfg(target_os = "wasi")'.dependencies]
69wasi = "0.11.0"
70libc = "0.2.159"
71
72[dev-dependencies]
73env_logger = { version = "0.9.3", default-features = false }
74rand = "0.8"
75
76[package.metadata.docs.rs]
77all-features = true
78rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"]
79targets = [
80 "aarch64-apple-ios",
81 "aarch64-linux-android",
82 "wasm32-wasi",
83 "x86_64-apple-darwin",
84 "x86_64-pc-windows-gnu",
85 "x86_64-pc-windows-msvc",
86 "x86_64-unknown-dragonfly",
87 "x86_64-unknown-freebsd",
88 "x86_64-unknown-illumos",
89 "x86_64-unknown-linux-gnu",
90 "x86_64-unknown-netbsd",
91 "x86_64-unknown-openbsd",
92 "x86_64-unknown-hermit",
93]
94
95[package.metadata.playground]
96features = ["os-poll", "os-ext", "net"]
97
98[[example]]
99name = "tcp_server"
100required-features = ["os-poll", "net"]
101
102[[example]]
103name = "tcp_listenfd_server"
104required-features = ["os-poll", "net"]
105
106[[example]]
107name = "udp_server"
108required-features = ["os-poll", "net"]
109
110[lints.rust]
111unexpected_cfgs = { level = "warn", check-cfg = ['cfg(mio_unsupported_force_poll_poll)', 'cfg(mio_unsupported_force_waker_pipe)'] }
112