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.36.0"
10edition = "2021"
11rust-version = "1.63"
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 = [
75 "num_cpus",
76 "rt",
77]
78signal = [
79 "libc",
80 "mio/os-poll",
81 "mio/net",
82 "mio/os-ext",
83 "signal-hook-registry",
84 "windows-sys/Win32_Foundation",
85 "windows-sys/Win32_System_Console",
86]
87sync = []
88test-util = ["rt", "sync", "time"]
89time = []
90
91[dependencies]
92tokio-macros = { version = "~2.2.0", path = "../tokio-macros", optional = true }
93
94pin-project-lite = "0.2.11"
95
96# Everything else is optional...
97bytes = { version = "1.0.0", optional = true }
98mio = { version = "0.8.9", optional = true, default-features = false }
99num_cpus = { version = "1.8.0", optional = true }
100parking_lot = { version = "0.12.0", optional = true }
101
102[target.'cfg(not(target_family = "wasm"))'.dependencies]
103socket2 = { version = "0.5.5", optional = true, features = [ "all" ] }
104
105# Currently unstable. The API exposed by these features may be broken at any time.
106# Requires `--cfg tokio_unstable` to enable.
107[target.'cfg(tokio_unstable)'.dependencies]
108tracing = { version = "0.1.25", default-features = false, features = ["std"], optional = true } # Not in full
109
110# Currently unstable. The API exposed by these features may be broken at any time.
111# Requires `--cfg tokio_unstable` to enable.
112[target.'cfg(tokio_taskdump)'.dependencies]
113backtrace = { version = "0.3.58" }
114
115[target.'cfg(unix)'.dependencies]
116libc = { version = "0.2.149", optional = true }
117signal-hook-registry = { version = "1.1.1", optional = true }
118
119[target.'cfg(unix)'.dev-dependencies]
120libc = { version = "0.2.149" }
121nix = { version = "0.27.1", default-features = false, features = ["fs", "socket"] }
122
123[target.'cfg(windows)'.dependencies.windows-sys]
124version = "0.48"
125optional = true
126
127[target.'cfg(windows)'.dev-dependencies.windows-sys]
128version = "0.48"
129features = [
130 "Win32_Foundation",
131 "Win32_Security_Authorization",
132]
133
134[dev-dependencies]
135tokio-test = { version = "0.4.0", path = "../tokio-test" }
136tokio-stream = { version = "0.1", path = "../tokio-stream" }
137futures = { version = "0.3.0", features = ["async-await"] }
138mockall = "0.11.1"
139async-stream = "0.3"
140
141[target.'cfg(not(target_family = "wasm"))'.dev-dependencies]
142socket2 = "0.5.5"
143tempfile = "3.1.0"
144
145[target.'cfg(not(all(target_family = "wasm", target_os = "unknown")))'.dev-dependencies]
146rand = "0.8.0"
147
148[target.'cfg(all(target_family = "wasm", not(target_os = "wasi")))'.dev-dependencies]
149wasm-bindgen-test = "0.3.0"
150
151[target.'cfg(target_os = "freebsd")'.dev-dependencies]
152mio-aio = { version = "0.8.0", features = ["tokio"] }
153
154[target.'cfg(loom)'.dev-dependencies]
155loom = { version = "0.7", features = ["futures", "checkpoint"] }
156
157[package.metadata.docs.rs]
158all-features = true
159# enable unstable features in the documentation
160rustdoc-args = ["--cfg", "docsrs", "--cfg", "tokio_unstable", "--cfg", "tokio_taskdump"]
161# it's necessary to _also_ pass `--cfg tokio_unstable` and `--cfg tokio_taskdump`
162# to rustc, or else dependencies will not be enabled, and the docs build will fail.
163rustc-args = ["--cfg", "tokio_unstable", "--cfg", "tokio_taskdump"]
164
165[package.metadata.playground]
166features = ["full", "test-util"]
167
168[package.metadata.cargo_check_external_types]
169# The following are types that are allowed to be exposed in Tokio's public API.
170# The standard library is allowed by default.
171allowed_external_types = [
172 "bytes::buf::buf_impl::Buf",
173 "bytes::buf::buf_mut::BufMut",
174
175 "tokio_macros::*",
176]
177