1[package]
2name = "tokio"
3# When releasing to crates.io:
4# - Remove path dependencies
5# - Update doc url
6# - README.md
7# - Update CHANGELOG.md.
8# - Create "v1.x.y" git tag.
9version = "1.44.2"
10edition = "2021"
11rust-version = "1.70"
12authors = ["Tokio Contributors <team@tokio.rs>"]
13license = "MIT"
14readme = "README.md"
15repository = "https://github.com/tokio-rs/tokio"
16homepage = "https://tokio.rs"
17description = """
18An event-driven, non-blocking I/O platform for writing asynchronous I/O
19backed applications.
20"""
21categories = ["asynchronous", "network-programming"]
22keywords = ["io", "async", "non-blocking", "futures"]
23
24[features]
25# Include nothing by default
26default = []
27
28# enable everything
29full = [
30 "fs",
31 "io-util",
32 "io-std",
33 "macros",
34 "net",
35 "parking_lot",
36 "process",
37 "rt",
38 "rt-multi-thread",
39 "signal",
40 "sync",
41 "time",
42]
43
44fs = []
45io-util = ["bytes"]
46# stdin, stdout, stderr
47io-std = []
48macros = ["tokio-macros"]
49net = [
50 "libc",
51 "mio/os-poll",
52 "mio/os-ext",
53 "mio/net",
54 "socket2",
55 "windows-sys/Win32_Foundation",
56 "windows-sys/Win32_Security",
57 "windows-sys/Win32_Storage_FileSystem",
58 "windows-sys/Win32_System_Pipes",
59 "windows-sys/Win32_System_SystemServices",
60]
61process = [
62 "bytes",
63 "libc",
64 "mio/os-poll",
65 "mio/os-ext",
66 "mio/net",
67 "signal-hook-registry",
68 "windows-sys/Win32_Foundation",
69 "windows-sys/Win32_System_Threading",
70 "windows-sys/Win32_System_WindowsProgramming",
71]
72# Includes basic task execution capabilities
73rt = []
74rt-multi-thread = ["rt"]
75signal = [
76 "libc",
77 "mio/os-poll",
78 "mio/net",
79 "mio/os-ext",
80 "signal-hook-registry",
81 "windows-sys/Win32_Foundation",
82 "windows-sys/Win32_System_Console",
83]
84sync = []
85test-util = ["rt", "sync", "time"]
86time = []
87
88[dependencies]
89tokio-macros = { version = "~2.5.0", path = "../tokio-macros", optional = true }
90
91pin-project-lite = "0.2.11"
92
93# Everything else is optional...
94bytes = { version = "1.2.1", optional = true }
95mio = { version = "1.0.1", optional = true, default-features = false }
96parking_lot = { version = "0.12.0", optional = true }
97
98[target.'cfg(not(target_family = "wasm"))'.dependencies]
99socket2 = { version = "0.5.5", optional = true, features = ["all"] }
100
101# Currently unstable. The API exposed by these features may be broken at any time.
102# Requires `--cfg tokio_unstable` to enable.
103[target.'cfg(tokio_unstable)'.dependencies]
104tracing = { version = "0.1.29", default-features = false, features = ["std"], optional = true } # Not in full
105
106# Currently unstable. The API exposed by these features may be broken at any time.
107# Requires `--cfg tokio_unstable` to enable.
108[target.'cfg(tokio_taskdump)'.dependencies]
109backtrace = { version = "0.3.58" }
110
111[target.'cfg(unix)'.dependencies]
112libc = { version = "0.2.168", optional = true }
113signal-hook-registry = { version = "1.1.1", optional = true }
114
115[target.'cfg(unix)'.dev-dependencies]
116libc = { version = "0.2.168" }
117nix = { version = "0.29.0", default-features = false, features = ["aio", "fs", "socket"] }
118
119[target.'cfg(windows)'.dependencies.windows-sys]
120version = "0.52"
121optional = true
122
123[target.'cfg(windows)'.dev-dependencies.windows-sys]
124version = "0.52"
125features = [
126 "Win32_Foundation",
127 "Win32_Security_Authorization",
128]
129
130[dev-dependencies]
131tokio-test = { version = "0.4.0", path = "../tokio-test" }
132tokio-stream = { version = "0.1", path = "../tokio-stream" }
133futures = { version = "0.3.0", features = ["async-await"] }
134mockall = "0.11.1"
135async-stream = "0.3"
136futures-concurrency = "7.6.3"
137
138[target.'cfg(not(target_family = "wasm"))'.dev-dependencies]
139socket2 = "0.5.5"
140tempfile = "3.1.0"
141proptest = "1"
142
143[target.'cfg(not(all(target_family = "wasm", target_os = "unknown")))'.dev-dependencies]
144rand = "0.8.0"
145
146[target.'cfg(all(target_family = "wasm", not(target_os = "wasi")))'.dev-dependencies]
147wasm-bindgen-test = "0.3.0"
148
149[target.'cfg(target_os = "freebsd")'.dev-dependencies]
150mio-aio = { version = "0.9.0", features = ["tokio"] }
151
152[target.'cfg(loom)'.dev-dependencies]
153loom = { version = "0.7", features = ["futures", "checkpoint"] }
154
155[target.'cfg(all(tokio_unstable, target_has_atomic = "64"))'.dev-dependencies]
156tracing-mock = "= 0.1.0-beta.1"
157
158[package.metadata.docs.rs]
159all-features = true
160# enable unstable features in the documentation
161rustdoc-args = ["--cfg", "docsrs", "--cfg", "tokio_unstable", "--cfg", "tokio_taskdump"]
162# it's necessary to _also_ pass `--cfg tokio_unstable` and `--cfg tokio_taskdump`
163# to rustc, or else dependencies will not be enabled, and the docs build will fail.
164rustc-args = ["--cfg", "tokio_unstable", "--cfg", "tokio_taskdump"]
165
166[package.metadata.playground]
167features = ["full", "test-util"]
168
169[package.metadata.cargo_check_external_types]
170# The following are types that are allowed to be exposed in Tokio's public API.
171# The standard library is allowed by default.
172allowed_external_types = [
173 "bytes::buf::buf_impl::Buf",
174 "bytes::buf::buf_mut::BufMut",
175 "tokio_macros::*",
176]
177
178[lints]
179workspace = true
180