html-to-markdown 2.27.2 → 2.27.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +8 -8
- data/ext/html-to-markdown-rb/native/Cargo.toml +1 -1
- data/lib/html_to_markdown/version.rb +1 -1
- data/rust-vendor/getrandom/.cargo-checksum.json +1 -1
- data/rust-vendor/getrandom/.cargo_vcs_info.json +1 -1
- data/rust-vendor/getrandom/CHANGELOG.md +62 -43
- data/rust-vendor/getrandom/Cargo.lock +49 -56
- data/rust-vendor/getrandom/Cargo.toml +2 -2
- data/rust-vendor/getrandom/Cargo.toml.orig +2 -2
- data/rust-vendor/getrandom/src/backends/efi_rng.rs +8 -10
- data/rust-vendor/getrandom/src/backends/getentropy.rs +13 -4
- data/rust-vendor/getrandom/src/backends/linux_android_with_fallback.rs +10 -25
- data/rust-vendor/getrandom/src/backends/netbsd.rs +17 -25
- data/rust-vendor/getrandom/src/backends/rdrand.rs +15 -9
- data/rust-vendor/getrandom/src/backends/rndr.rs +2 -1
- data/rust-vendor/getrandom/src/backends/vxworks.rs +7 -3
- data/rust-vendor/getrandom/src/backends/windows.rs +21 -5
- data/rust-vendor/getrandom/src/utils/lazy_bool.rs +39 -0
- data/rust-vendor/getrandom/src/utils/lazy_ptr.rs +57 -0
- data/rust-vendor/html-to-markdown-rs/Cargo.toml +2 -2
- data/rust-vendor/html-to-markdown-rs/src/converter/text_node.rs +2 -1
- data/rust-vendor/html-to-markdown-rs/tests/issue_216_217_regressions.rs +82 -0
- data/rust-vendor/quote/.cargo-checksum.json +1 -1
- data/rust-vendor/quote/.cargo_vcs_info.json +1 -1
- data/rust-vendor/quote/.github/workflows/ci.yml +2 -2
- data/rust-vendor/quote/Cargo.lock +21 -21
- data/rust-vendor/quote/Cargo.toml +2 -2
- data/rust-vendor/quote/Cargo.toml.orig +2 -2
- data/rust-vendor/quote/README.md +0 -1
- data/rust-vendor/quote/src/lib.rs +1 -1
- data/rust-vendor/quote/src/to_tokens.rs +7 -0
- data/rust-vendor/quote/tests/ui/not-quotable.stderr +1 -1
- data/rust-vendor/quote/tests/ui/not-repeatable.stderr +3 -11
- data/rust-vendor/r-efi/.cargo-checksum.json +1 -1
- data/rust-vendor/r-efi/.cargo_vcs_info.json +1 -1
- data/rust-vendor/r-efi/AUTHORS +1 -0
- data/rust-vendor/r-efi/Cargo.lock +1 -1
- data/rust-vendor/r-efi/Cargo.toml +1 -3
- data/rust-vendor/r-efi/Cargo.toml.orig +1 -5
- data/rust-vendor/r-efi/NEWS.md +16 -0
- data/rust-vendor/r-efi/src/base.rs +1 -1
- data/rust-vendor/r-efi/src/lib.rs +27 -12
- data/rust-vendor/r-efi/src/protocols/absolute_pointer.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/block_io.rs +8 -8
- data/rust-vendor/r-efi/src/protocols/bus_specific_driver_override.rs +2 -2
- data/rust-vendor/r-efi/src/protocols/debug_support.rs +10 -10
- data/rust-vendor/r-efi/src/protocols/debugport.rs +8 -8
- data/rust-vendor/r-efi/src/protocols/decompress.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/device_path_from_text.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/device_path_to_text.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/device_path_utilities.rs +16 -16
- data/rust-vendor/r-efi/src/protocols/disk_io.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/disk_io2.rs +8 -8
- data/rust-vendor/r-efi/src/protocols/driver_binding.rs +6 -6
- data/rust-vendor/r-efi/src/protocols/driver_diagnostics2.rs +2 -2
- data/rust-vendor/r-efi/src/protocols/driver_family_override.rs +2 -2
- data/rust-vendor/r-efi/src/protocols/file.rs +28 -28
- data/rust-vendor/r-efi/src/protocols/graphics_output.rs +6 -6
- data/rust-vendor/r-efi/src/protocols/hii_database.rs +24 -24
- data/rust-vendor/r-efi/src/protocols/hii_font.rs +8 -8
- data/rust-vendor/r-efi/src/protocols/hii_font_ex.rs +10 -10
- data/rust-vendor/r-efi/src/protocols/hii_string.rs +10 -10
- data/rust-vendor/r-efi/src/protocols/ip4.rs +16 -16
- data/rust-vendor/r-efi/src/protocols/ip6.rs +18 -18
- data/rust-vendor/r-efi/src/protocols/load_file.rs +2 -2
- data/rust-vendor/r-efi/src/protocols/loaded_image.rs +2 -2
- data/rust-vendor/r-efi/src/protocols/managed_network.rs +16 -16
- data/rust-vendor/r-efi/src/protocols/memory_attribute.rs +6 -6
- data/rust-vendor/r-efi/src/protocols/mp_services.rs +15 -15
- data/rust-vendor/r-efi/src/protocols/pci_io.rs +26 -26
- data/rust-vendor/r-efi/src/protocols/platform_driver_override.rs +6 -6
- data/rust-vendor/r-efi/src/protocols/rng.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/service_binding.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/shell.rs +81 -81
- data/rust-vendor/r-efi/src/protocols/shell_dynamic_command.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/simple_file_system.rs +2 -2
- data/rust-vendor/r-efi/src/protocols/simple_network.rs +26 -26
- data/rust-vendor/r-efi/src/protocols/simple_text_input.rs +4 -4
- data/rust-vendor/r-efi/src/protocols/simple_text_input_ex.rs +11 -11
- data/rust-vendor/r-efi/src/protocols/simple_text_output.rs +18 -18
- data/rust-vendor/r-efi/src/protocols/tcp4.rs +20 -20
- data/rust-vendor/r-efi/src/protocols/tcp6.rs +18 -18
- data/rust-vendor/r-efi/src/protocols/timestamp.rs +3 -3
- data/rust-vendor/r-efi/src/protocols/udp4.rs +16 -16
- data/rust-vendor/r-efi/src/protocols/udp6.rs +14 -14
- data/rust-vendor/r-efi/src/system.rs +115 -115
- data/rust-vendor/r-efi/src/vendor/intel/console_control.rs +6 -6
- data/rust-vendor/r-efi-5.3.0/.cargo-checksum.json +1 -0
- data/rust-vendor/r-efi-5.3.0/.cargo_vcs_info.json +6 -0
- data/rust-vendor/r-efi-5.3.0/.github/workflows/publish.yml +39 -0
- data/rust-vendor/r-efi-5.3.0/.github/workflows/rust-tests.yml +125 -0
- data/rust-vendor/r-efi-5.3.0/AUTHORS +74 -0
- data/rust-vendor/r-efi-5.3.0/Cargo.lock +16 -0
- data/rust-vendor/r-efi-5.3.0/Cargo.toml +70 -0
- data/rust-vendor/r-efi-5.3.0/Cargo.toml.orig +51 -0
- data/rust-vendor/r-efi-5.3.0/Makefile +85 -0
- data/rust-vendor/r-efi-5.3.0/NEWS.md +301 -0
- data/rust-vendor/r-efi-5.3.0/README.md +99 -0
- data/rust-vendor/r-efi-5.3.0/examples/freestanding.rs +34 -0
- data/rust-vendor/r-efi-5.3.0/examples/gop-query.rs +188 -0
- data/rust-vendor/r-efi-5.3.0/examples/hello-world.rs +55 -0
- data/rust-vendor/r-efi-5.3.0/src/base.rs +993 -0
- data/rust-vendor/r-efi-5.3.0/src/hii.rs +1300 -0
- data/rust-vendor/r-efi-5.3.0/src/lib.rs +182 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/absolute_pointer.rs +69 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/block_io.rs +70 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/bus_specific_driver_override.rs +32 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/debug_support.rs +835 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/debugport.rs +42 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/decompress.rs +37 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/device_path.rs +82 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/device_path_from_text.rs +26 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/device_path_to_text.rs +30 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/device_path_utilities.rs +63 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/disk_io.rs +40 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/disk_io2.rs +58 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/driver_binding.rs +42 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/driver_diagnostics2.rs +38 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/driver_family_override.rs +23 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/file.rs +183 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/graphics_output.rs +103 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/hii_database.rs +299 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/hii_font.rs +87 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/hii_font_ex.rs +107 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/hii_package_list.rs +14 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/hii_string.rs +71 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/ip4.rs +202 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/ip6.rs +264 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/load_file.rs +26 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/load_file2.rs +15 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/loaded_image.rs +39 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/loaded_image_device_path.rs +13 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/managed_network.rs +147 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/memory_attribute.rs +40 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/mp_services.rs +121 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/pci_io.rs +203 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/platform_driver_override.rs +46 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/rng.rs +83 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/service_binding.rs +20 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/shell.rs +295 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/shell_dynamic_command.rs +33 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/shell_parameters.rs +23 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/simple_file_system.rs +26 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/simple_network.rs +196 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/simple_text_input.rs +38 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/simple_text_input_ex.rs +85 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/simple_text_output.rs +86 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/tcp4.rs +224 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/tcp6.rs +202 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/timestamp.rs +32 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/udp4.rs +151 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols/udp6.rs +137 -0
- data/rust-vendor/r-efi-5.3.0/src/protocols.rs +54 -0
- data/rust-vendor/r-efi-5.3.0/src/system.rs +1130 -0
- data/rust-vendor/r-efi-5.3.0/src/vendor/intel/console_control.rs +37 -0
- data/rust-vendor/r-efi-5.3.0/src/vendor.rs +10 -0
- data/rust-vendor/tokio/.cargo-checksum.json +1 -1
- data/rust-vendor/tokio/.cargo_vcs_info.json +1 -1
- data/rust-vendor/tokio/CHANGELOG.md +94 -0
- data/rust-vendor/tokio/Cargo.lock +1549 -0
- data/rust-vendor/tokio/Cargo.toml +96 -83
- data/rust-vendor/tokio/Cargo.toml.orig +7 -7
- data/rust-vendor/tokio/README.md +1 -1
- data/rust-vendor/tokio/src/fs/open_options.rs +4 -1
- data/rust-vendor/tokio/src/fs/read.rs +4 -1
- data/rust-vendor/tokio/src/fs/write.rs +4 -1
- data/rust-vendor/tokio/src/io/async_write.rs +3 -4
- data/rust-vendor/tokio/src/io/poll_evented.rs +23 -1
- data/rust-vendor/tokio/src/io/stderr.rs +15 -1
- data/rust-vendor/tokio/src/io/stdout.rs +14 -0
- data/rust-vendor/tokio/src/io/util/async_write_ext.rs +2 -2
- data/rust-vendor/tokio/src/io/util/write_buf.rs +11 -2
- data/rust-vendor/tokio/src/lib.rs +12 -28
- data/rust-vendor/tokio/src/macros/select.rs +6 -8
- data/rust-vendor/tokio/src/net/tcp/socket.rs +25 -1
- data/rust-vendor/tokio/src/net/tcp/stream.rs +40 -1
- data/rust-vendor/tokio/src/process/unix/pidfd_reaper.rs +1 -41
- data/rust-vendor/tokio/src/runtime/blocking/pool.rs +18 -14
- data/rust-vendor/tokio/src/runtime/builder.rs +10 -4
- data/rust-vendor/tokio/src/runtime/handle.rs +3 -2
- data/rust-vendor/tokio/src/runtime/io/driver/uring.rs +49 -61
- data/rust-vendor/tokio/src/runtime/io/driver.rs +6 -5
- data/rust-vendor/tokio/src/runtime/mod.rs +20 -1
- data/rust-vendor/tokio/src/runtime/runtime.rs +71 -1
- data/rust-vendor/tokio/src/runtime/scheduler/current_thread/mod.rs +24 -8
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/worker.rs +5 -0
- data/rust-vendor/tokio/src/runtime/task/core.rs +1 -0
- data/rust-vendor/tokio/src/runtime/task/join.rs +7 -3
- data/rust-vendor/tokio/src/runtime/task/list.rs +5 -3
- data/rust-vendor/tokio/src/runtime/task/mod.rs +0 -5
- data/rust-vendor/tokio/src/runtime/tests/loom_blocking.rs +39 -1
- data/rust-vendor/tokio/src/signal/mod.rs +6 -17
- data/rust-vendor/tokio/src/signal/registry.rs +1 -1
- data/rust-vendor/tokio/src/signal/unix.rs +24 -44
- data/rust-vendor/tokio/src/signal/windows/sys.rs +52 -64
- data/rust-vendor/tokio/src/signal/windows.rs +35 -23
- data/rust-vendor/tokio/src/sync/mpsc/mod.rs +3 -1
- data/rust-vendor/tokio/src/sync/oneshot.rs +13 -0
- data/rust-vendor/tokio/src/sync/rwlock.rs +4 -5
- data/rust-vendor/tokio/src/sync/tests/loom_oneshot.rs +27 -1
- data/rust-vendor/tokio/src/task/blocking.rs +16 -1
- data/rust-vendor/tokio/src/task/builder.rs +2 -2
- data/rust-vendor/tokio/src/task/mod.rs +1 -1
- data/rust-vendor/tokio/src/task/spawn.rs +8 -3
- data/rust-vendor/tokio/src/task/yield_now.rs +13 -23
- data/rust-vendor/tokio/src/time/clock.rs +62 -0
- data/rust-vendor/tokio/src/util/memchr.rs +32 -4
- data/rust-vendor/tokio/src/util/sharded_list.rs +6 -4
- data/rust-vendor/tokio/tests/fs_link.rs +54 -0
- data/rust-vendor/tokio/tests/io_async_fd_memory_leak.rs +209 -0
- data/rust-vendor/tokio/tests/io_write_buf.rs +56 -0
- data/rust-vendor/tokio/tests/process_issue_7144.rs +8 -0
- data/rust-vendor/tokio/tests/rt_basic.rs +41 -0
- data/rust-vendor/tokio/tests/rt_common_before_park.rs +92 -0
- data/rust-vendor/tokio/tests/rt_metrics.rs +1 -1
- data/rust-vendor/tokio/tests/rt_panic.rs +12 -0
- data/rust-vendor/tokio/tests/rt_shutdown_err.rs +82 -0
- data/rust-vendor/tokio/tests/rt_threaded.rs +49 -1
- data/rust-vendor/tokio/tests/rt_unstable_metrics.rs +32 -0
- data/rust-vendor/tokio/tests/tcp_connect.rs +2 -3
- data/rust-vendor/tokio/tests/tcp_shutdown.rs +1 -3
- data/rust-vendor/tokio/tests/tcp_socket.rs +3 -4
- data/rust-vendor/tokio/tests/tcp_stream.rs +3 -0
- metadata +78 -3
- data/rust-vendor/getrandom/src/utils/lazy.rs +0 -64
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
edition = "2021"
|
|
14
14
|
rust-version = "1.71"
|
|
15
15
|
name = "tokio"
|
|
16
|
-
version = "1.
|
|
16
|
+
version = "1.50.0"
|
|
17
17
|
authors = ["Tokio Contributors <team@tokio.rs>"]
|
|
18
18
|
build = false
|
|
19
|
+
autolib = false
|
|
19
20
|
autobins = false
|
|
20
21
|
autoexamples = false
|
|
21
22
|
autotests = false
|
|
@@ -39,25 +40,18 @@ categories = [
|
|
|
39
40
|
license = "MIT"
|
|
40
41
|
repository = "https://github.com/tokio-rs/tokio"
|
|
41
42
|
|
|
42
|
-
[package.metadata.cargo_check_external_types]
|
|
43
|
-
allowed_external_types = [
|
|
44
|
-
"bytes::buf::buf_impl::Buf",
|
|
45
|
-
"bytes::buf::buf_mut::BufMut",
|
|
46
|
-
"tokio_macros::*",
|
|
47
|
-
]
|
|
48
|
-
|
|
49
43
|
[package.metadata.docs.rs]
|
|
50
44
|
all-features = true
|
|
51
|
-
rustc-args = [
|
|
52
|
-
"--cfg",
|
|
53
|
-
"tokio_unstable",
|
|
54
|
-
]
|
|
55
45
|
rustdoc-args = [
|
|
56
46
|
"--cfg",
|
|
57
47
|
"docsrs",
|
|
58
48
|
"--cfg",
|
|
59
49
|
"tokio_unstable",
|
|
60
50
|
]
|
|
51
|
+
rustc-args = [
|
|
52
|
+
"--cfg",
|
|
53
|
+
"tokio_unstable",
|
|
54
|
+
]
|
|
61
55
|
|
|
62
56
|
[package.metadata.playground]
|
|
63
57
|
features = [
|
|
@@ -65,6 +59,83 @@ features = [
|
|
|
65
59
|
"test-util",
|
|
66
60
|
]
|
|
67
61
|
|
|
62
|
+
[package.metadata.cargo_check_external_types]
|
|
63
|
+
allowed_external_types = [
|
|
64
|
+
"bytes::buf::buf_impl::Buf",
|
|
65
|
+
"bytes::buf::buf_mut::BufMut",
|
|
66
|
+
"tokio_macros::*",
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
[features]
|
|
70
|
+
default = []
|
|
71
|
+
fs = []
|
|
72
|
+
full = [
|
|
73
|
+
"fs",
|
|
74
|
+
"io-util",
|
|
75
|
+
"io-std",
|
|
76
|
+
"macros",
|
|
77
|
+
"net",
|
|
78
|
+
"parking_lot",
|
|
79
|
+
"process",
|
|
80
|
+
"rt",
|
|
81
|
+
"rt-multi-thread",
|
|
82
|
+
"signal",
|
|
83
|
+
"sync",
|
|
84
|
+
"time",
|
|
85
|
+
]
|
|
86
|
+
io-std = []
|
|
87
|
+
io-uring = [
|
|
88
|
+
"dep:io-uring",
|
|
89
|
+
"libc",
|
|
90
|
+
"mio/os-poll",
|
|
91
|
+
"mio/os-ext",
|
|
92
|
+
"dep:slab",
|
|
93
|
+
]
|
|
94
|
+
io-util = ["bytes"]
|
|
95
|
+
macros = ["tokio-macros"]
|
|
96
|
+
net = [
|
|
97
|
+
"libc",
|
|
98
|
+
"mio/os-poll",
|
|
99
|
+
"mio/os-ext",
|
|
100
|
+
"mio/net",
|
|
101
|
+
"socket2",
|
|
102
|
+
"windows-sys/Win32_Foundation",
|
|
103
|
+
"windows-sys/Win32_Security",
|
|
104
|
+
"windows-sys/Win32_Storage_FileSystem",
|
|
105
|
+
"windows-sys/Win32_System_Pipes",
|
|
106
|
+
"windows-sys/Win32_System_SystemServices",
|
|
107
|
+
]
|
|
108
|
+
process = [
|
|
109
|
+
"bytes",
|
|
110
|
+
"libc",
|
|
111
|
+
"mio/os-poll",
|
|
112
|
+
"mio/os-ext",
|
|
113
|
+
"mio/net",
|
|
114
|
+
"signal-hook-registry",
|
|
115
|
+
"windows-sys/Win32_Foundation",
|
|
116
|
+
"windows-sys/Win32_System_Threading",
|
|
117
|
+
"windows-sys/Win32_System_WindowsProgramming",
|
|
118
|
+
]
|
|
119
|
+
rt = []
|
|
120
|
+
rt-multi-thread = ["rt"]
|
|
121
|
+
signal = [
|
|
122
|
+
"libc",
|
|
123
|
+
"mio/os-poll",
|
|
124
|
+
"mio/net",
|
|
125
|
+
"mio/os-ext",
|
|
126
|
+
"signal-hook-registry",
|
|
127
|
+
"windows-sys/Win32_Foundation",
|
|
128
|
+
"windows-sys/Win32_System_Console",
|
|
129
|
+
]
|
|
130
|
+
sync = []
|
|
131
|
+
taskdump = ["dep:backtrace"]
|
|
132
|
+
test-util = [
|
|
133
|
+
"rt",
|
|
134
|
+
"sync",
|
|
135
|
+
"time",
|
|
136
|
+
]
|
|
137
|
+
time = []
|
|
138
|
+
|
|
68
139
|
[lib]
|
|
69
140
|
name = "tokio"
|
|
70
141
|
path = "src/lib.rs"
|
|
@@ -165,6 +236,10 @@ path = "tests/fs_write.rs"
|
|
|
165
236
|
name = "io_async_fd"
|
|
166
237
|
path = "tests/io_async_fd.rs"
|
|
167
238
|
|
|
239
|
+
[[test]]
|
|
240
|
+
name = "io_async_fd_memory_leak"
|
|
241
|
+
path = "tests/io_async_fd_memory_leak.rs"
|
|
242
|
+
|
|
168
243
|
[[test]]
|
|
169
244
|
name = "io_async_read"
|
|
170
245
|
path = "tests/io_async_read.rs"
|
|
@@ -389,6 +464,10 @@ path = "tests/rt_basic.rs"
|
|
|
389
464
|
name = "rt_common"
|
|
390
465
|
path = "tests/rt_common.rs"
|
|
391
466
|
|
|
467
|
+
[[test]]
|
|
468
|
+
name = "rt_common_before_park"
|
|
469
|
+
path = "tests/rt_common_before_park.rs"
|
|
470
|
+
|
|
392
471
|
[[test]]
|
|
393
472
|
name = "rt_handle"
|
|
394
473
|
path = "tests/rt_handle.rs"
|
|
@@ -413,6 +492,10 @@ path = "tests/rt_panic.rs"
|
|
|
413
492
|
name = "rt_poll_callbacks"
|
|
414
493
|
path = "tests/rt_poll_callbacks.rs"
|
|
415
494
|
|
|
495
|
+
[[test]]
|
|
496
|
+
name = "rt_shutdown_err"
|
|
497
|
+
path = "tests/rt_shutdown_err.rs"
|
|
498
|
+
|
|
416
499
|
[[test]]
|
|
417
500
|
name = "rt_threaded"
|
|
418
501
|
path = "tests/rt_threaded.rs"
|
|
@@ -751,76 +834,6 @@ version = "0.4.0"
|
|
|
751
834
|
version = "0.7"
|
|
752
835
|
features = ["rt"]
|
|
753
836
|
|
|
754
|
-
[features]
|
|
755
|
-
default = []
|
|
756
|
-
fs = []
|
|
757
|
-
full = [
|
|
758
|
-
"fs",
|
|
759
|
-
"io-util",
|
|
760
|
-
"io-std",
|
|
761
|
-
"macros",
|
|
762
|
-
"net",
|
|
763
|
-
"parking_lot",
|
|
764
|
-
"process",
|
|
765
|
-
"rt",
|
|
766
|
-
"rt-multi-thread",
|
|
767
|
-
"signal",
|
|
768
|
-
"sync",
|
|
769
|
-
"time",
|
|
770
|
-
]
|
|
771
|
-
io-std = []
|
|
772
|
-
io-uring = [
|
|
773
|
-
"dep:io-uring",
|
|
774
|
-
"libc",
|
|
775
|
-
"mio/os-poll",
|
|
776
|
-
"mio/os-ext",
|
|
777
|
-
"dep:slab",
|
|
778
|
-
]
|
|
779
|
-
io-util = ["bytes"]
|
|
780
|
-
macros = ["tokio-macros"]
|
|
781
|
-
net = [
|
|
782
|
-
"libc",
|
|
783
|
-
"mio/os-poll",
|
|
784
|
-
"mio/os-ext",
|
|
785
|
-
"mio/net",
|
|
786
|
-
"socket2",
|
|
787
|
-
"windows-sys/Win32_Foundation",
|
|
788
|
-
"windows-sys/Win32_Security",
|
|
789
|
-
"windows-sys/Win32_Storage_FileSystem",
|
|
790
|
-
"windows-sys/Win32_System_Pipes",
|
|
791
|
-
"windows-sys/Win32_System_SystemServices",
|
|
792
|
-
]
|
|
793
|
-
process = [
|
|
794
|
-
"bytes",
|
|
795
|
-
"libc",
|
|
796
|
-
"mio/os-poll",
|
|
797
|
-
"mio/os-ext",
|
|
798
|
-
"mio/net",
|
|
799
|
-
"signal-hook-registry",
|
|
800
|
-
"windows-sys/Win32_Foundation",
|
|
801
|
-
"windows-sys/Win32_System_Threading",
|
|
802
|
-
"windows-sys/Win32_System_WindowsProgramming",
|
|
803
|
-
]
|
|
804
|
-
rt = []
|
|
805
|
-
rt-multi-thread = ["rt"]
|
|
806
|
-
signal = [
|
|
807
|
-
"libc",
|
|
808
|
-
"mio/os-poll",
|
|
809
|
-
"mio/net",
|
|
810
|
-
"mio/os-ext",
|
|
811
|
-
"signal-hook-registry",
|
|
812
|
-
"windows-sys/Win32_Foundation",
|
|
813
|
-
"windows-sys/Win32_System_Console",
|
|
814
|
-
]
|
|
815
|
-
sync = []
|
|
816
|
-
taskdump = ["dep:backtrace"]
|
|
817
|
-
test-util = [
|
|
818
|
-
"rt",
|
|
819
|
-
"sync",
|
|
820
|
-
"time",
|
|
821
|
-
]
|
|
822
|
-
time = []
|
|
823
|
-
|
|
824
837
|
[target.'cfg(all(target_family = "wasm", not(target_os = "wasi")))'.dev-dependencies.wasm-bindgen-test]
|
|
825
838
|
version = "0.3.0"
|
|
826
839
|
|
|
@@ -832,7 +845,7 @@ version = "0.3.58"
|
|
|
832
845
|
optional = true
|
|
833
846
|
|
|
834
847
|
[target.'cfg(all(tokio_unstable, target_os = "linux"))'.dependencies.io-uring]
|
|
835
|
-
version = "0.7.
|
|
848
|
+
version = "0.7.11"
|
|
836
849
|
optional = true
|
|
837
850
|
default-features = false
|
|
838
851
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "tokio"
|
|
3
3
|
# When releasing to crates.io:
|
|
4
|
-
# - Remove path dependencies
|
|
4
|
+
# - Remove path dependencies (if any)
|
|
5
5
|
# - Update doc url
|
|
6
6
|
# - README.md
|
|
7
7
|
# - Update CHANGELOG.md.
|
|
8
8
|
# - Create "v1.x.y" git tag.
|
|
9
|
-
version = "1.
|
|
9
|
+
version = "1.50.0"
|
|
10
10
|
edition = "2021"
|
|
11
11
|
rust-version = "1.71"
|
|
12
12
|
authors = ["Tokio Contributors <team@tokio.rs>"]
|
|
@@ -90,7 +90,7 @@ io-uring = ["dep:io-uring", "libc", "mio/os-poll", "mio/os-ext", "dep:slab"]
|
|
|
90
90
|
taskdump = ["dep:backtrace"]
|
|
91
91
|
|
|
92
92
|
[dependencies]
|
|
93
|
-
tokio-macros = { version = "~2.6.0",
|
|
93
|
+
tokio-macros = { version = "~2.6.0", optional = true }
|
|
94
94
|
|
|
95
95
|
pin-project-lite = "0.2.11"
|
|
96
96
|
|
|
@@ -110,7 +110,7 @@ tracing = { version = "0.1.29", default-features = false, features = ["std"], op
|
|
|
110
110
|
# Currently unstable. The API exposed by these features may be broken at any time.
|
|
111
111
|
# Requires `--cfg tokio_unstable` to enable.
|
|
112
112
|
[target.'cfg(all(tokio_unstable, target_os = "linux"))'.dependencies]
|
|
113
|
-
io-uring = { version = "0.7.
|
|
113
|
+
io-uring = { version = "0.7.11", default-features = false, optional = true }
|
|
114
114
|
libc = { version = "0.2.168", optional = true }
|
|
115
115
|
mio = { version = "1.0.1", default-features = false, features = ["os-poll", "os-ext"], optional = true }
|
|
116
116
|
slab = { version = "0.4.9", optional = true }
|
|
@@ -136,9 +136,9 @@ features = [
|
|
|
136
136
|
]
|
|
137
137
|
|
|
138
138
|
[dev-dependencies]
|
|
139
|
-
tokio-test =
|
|
140
|
-
tokio-stream =
|
|
141
|
-
tokio-util = { version = "0.7",
|
|
139
|
+
tokio-test = "0.4.0"
|
|
140
|
+
tokio-stream = "0.1"
|
|
141
|
+
tokio-util = { version = "0.7", features = ["rt"] }
|
|
142
142
|
futures = { version = "0.3.0", features = ["async-await"] }
|
|
143
143
|
futures-test = "0.3.31"
|
|
144
144
|
mockall = "0.13.0"
|
data/rust-vendor/tokio/README.md
CHANGED
|
@@ -531,7 +531,10 @@ impl OpenOptions {
|
|
|
531
531
|
let handle = crate::runtime::Handle::current();
|
|
532
532
|
let driver_handle = handle.inner.driver().io();
|
|
533
533
|
|
|
534
|
-
if driver_handle
|
|
534
|
+
if driver_handle
|
|
535
|
+
.check_and_init(io_uring::opcode::OpenAt::CODE)
|
|
536
|
+
.await?
|
|
537
|
+
{
|
|
535
538
|
Op::open(path.as_ref(), opts)?.await
|
|
536
539
|
} else {
|
|
537
540
|
let opts = opts.clone().into();
|
|
@@ -68,7 +68,10 @@ pub async fn read(path: impl AsRef<Path>) -> io::Result<Vec<u8>> {
|
|
|
68
68
|
|
|
69
69
|
let handle = crate::runtime::Handle::current();
|
|
70
70
|
let driver_handle = handle.inner.driver().io();
|
|
71
|
-
if driver_handle
|
|
71
|
+
if driver_handle
|
|
72
|
+
.check_and_init(io_uring::opcode::Read::CODE)
|
|
73
|
+
.await?
|
|
74
|
+
{
|
|
72
75
|
return read_uring(&path).await;
|
|
73
76
|
}
|
|
74
77
|
}
|
|
@@ -37,7 +37,10 @@ pub async fn write(path: impl AsRef<Path>, contents: impl AsRef<[u8]>) -> io::Re
|
|
|
37
37
|
{
|
|
38
38
|
let handle = crate::runtime::Handle::current();
|
|
39
39
|
let driver_handle = handle.inner.driver().io();
|
|
40
|
-
if driver_handle
|
|
40
|
+
if driver_handle
|
|
41
|
+
.check_and_init(io_uring::opcode::Write::CODE)
|
|
42
|
+
.await?
|
|
43
|
+
{
|
|
41
44
|
return write_uring(path, contents).await;
|
|
42
45
|
}
|
|
43
46
|
}
|
|
@@ -27,11 +27,10 @@ use std::task::{Context, Poll};
|
|
|
27
27
|
/// * `Poll::Ready(Err(e))` for other errors are standard I/O errors coming from the
|
|
28
28
|
/// underlying object.
|
|
29
29
|
///
|
|
30
|
-
/// This trait importantly means that the `write` method only works in the
|
|
31
|
-
/// context of a future's task. The object may panic if used outside of a task.
|
|
32
|
-
///
|
|
33
30
|
/// Utilities for working with `AsyncWrite` values are provided by
|
|
34
|
-
/// [`AsyncWriteExt`].
|
|
31
|
+
/// [`AsyncWriteExt`]. Most users will interact with `AsyncWrite` types through
|
|
32
|
+
/// these extension methods, which provide ergonomic async functions such as
|
|
33
|
+
/// `write_all` and `flush`.
|
|
35
34
|
///
|
|
36
35
|
/// [`std::io::Write`]: std::io::Write
|
|
37
36
|
/// [`Write::write`]: std::io::Write::write()
|
|
@@ -188,6 +188,7 @@ feature! {
|
|
|
188
188
|
// Read more:
|
|
189
189
|
// https://github.com/tokio-rs/tokio/issues/5866
|
|
190
190
|
#[cfg(all(
|
|
191
|
+
// keep in sync with poll_write
|
|
191
192
|
not(mio_unsupported_force_poll_poll),
|
|
192
193
|
any(
|
|
193
194
|
// epoll
|
|
@@ -240,7 +241,28 @@ feature! {
|
|
|
240
241
|
// that the socket buffer is full. Unfortunately this assumption
|
|
241
242
|
// fails for level-triggered selectors (like on Windows or poll even for
|
|
242
243
|
// UNIX): https://github.com/tokio-rs/tokio/issues/5866
|
|
243
|
-
|
|
244
|
+
#[cfg(all(
|
|
245
|
+
// keep in sync with poll_read
|
|
246
|
+
not(mio_unsupported_force_poll_poll),
|
|
247
|
+
any(
|
|
248
|
+
// epoll
|
|
249
|
+
target_os = "android",
|
|
250
|
+
target_os = "illumos",
|
|
251
|
+
target_os = "linux",
|
|
252
|
+
target_os = "redox",
|
|
253
|
+
// kqueue
|
|
254
|
+
target_os = "dragonfly",
|
|
255
|
+
target_os = "freebsd",
|
|
256
|
+
target_os = "ios",
|
|
257
|
+
target_os = "macos",
|
|
258
|
+
target_os = "netbsd",
|
|
259
|
+
target_os = "openbsd",
|
|
260
|
+
target_os = "tvos",
|
|
261
|
+
target_os = "visionos",
|
|
262
|
+
target_os = "watchos",
|
|
263
|
+
)
|
|
264
|
+
))]
|
|
265
|
+
if 0 < n && n < buf.len() {
|
|
244
266
|
self.registration.clear_readiness(evt);
|
|
245
267
|
}
|
|
246
268
|
|
|
@@ -29,7 +29,7 @@ cfg_io_std! {
|
|
|
29
29
|
///
|
|
30
30
|
/// #[tokio::main]
|
|
31
31
|
/// async fn main() -> io::Result<()> {
|
|
32
|
-
/// let mut stderr = io::
|
|
32
|
+
/// let mut stderr = io::stderr();
|
|
33
33
|
/// stderr.write_all(b"Print some error here.").await?;
|
|
34
34
|
/// Ok(())
|
|
35
35
|
/// }
|
|
@@ -50,6 +50,20 @@ cfg_io_std! {
|
|
|
50
50
|
/// to occur as a single write, so multiple threads writing data with
|
|
51
51
|
/// [`write_all`] may result in interleaved output.
|
|
52
52
|
///
|
|
53
|
+
/// Note that unlike [`std::io::stderr`], each call to this `stderr()`
|
|
54
|
+
/// produces a new writer, so for example, this program does **not** flush stderr:
|
|
55
|
+
///
|
|
56
|
+
/// ```no_run
|
|
57
|
+
/// # use tokio::io::AsyncWriteExt;
|
|
58
|
+
/// # #[tokio::main]
|
|
59
|
+
/// # async fn main() -> std::io::Result<()> {
|
|
60
|
+
/// tokio::io::stderr().write_all(b"aa").await?;
|
|
61
|
+
/// tokio::io::stderr().flush().await?;
|
|
62
|
+
/// # Ok(())
|
|
63
|
+
/// # }
|
|
64
|
+
/// ```
|
|
65
|
+
///
|
|
66
|
+
/// [`std::io::stderr`]: std::io::stderr
|
|
53
67
|
/// [`AsyncWrite`]: AsyncWrite
|
|
54
68
|
/// [`write_all`]: crate::io::AsyncWriteExt::write_all()
|
|
55
69
|
///
|
|
@@ -74,6 +74,20 @@ cfg_io_std! {
|
|
|
74
74
|
/// to occur as a single write, so multiple threads writing data with
|
|
75
75
|
/// [`write_all`] may result in interleaved output.
|
|
76
76
|
///
|
|
77
|
+
/// Note that unlike [`std::io::stdout`], each call to this `stdout()`
|
|
78
|
+
/// produces a new writer, so for example, this program does **not** flush stdout:
|
|
79
|
+
///
|
|
80
|
+
/// ```no_run
|
|
81
|
+
/// # use tokio::io::AsyncWriteExt;
|
|
82
|
+
/// # #[tokio::main]
|
|
83
|
+
/// # async fn main() -> std::io::Result<()> {
|
|
84
|
+
/// tokio::io::stdout().write_all(b"aa").await?;
|
|
85
|
+
/// tokio::io::stdout().flush().await?;
|
|
86
|
+
/// # Ok(())
|
|
87
|
+
/// # }
|
|
88
|
+
/// ```
|
|
89
|
+
///
|
|
90
|
+
/// [`std::io::stdout`]: std::io::stdout
|
|
77
91
|
/// [`AsyncWrite`]: AsyncWrite
|
|
78
92
|
/// [`write_all`]: crate::io::AsyncWriteExt::write_all()
|
|
79
93
|
///
|
|
@@ -1294,8 +1294,8 @@ cfg_io_util! {
|
|
|
1294
1294
|
/// async fn shutdown(&mut self) -> io::Result<()>;
|
|
1295
1295
|
/// ```
|
|
1296
1296
|
///
|
|
1297
|
-
/// Similar to [`flush`], all intermediately buffered is written to
|
|
1298
|
-
/// underlying stream. Once the operation completes, the caller should
|
|
1297
|
+
/// Similar to [`flush`], all intermediately buffered content is written to
|
|
1298
|
+
/// the underlying stream. Once the operation completes, the caller should
|
|
1299
1299
|
/// no longer attempt to write to the stream. For example, the
|
|
1300
1300
|
/// `TcpStream` implementation will issue a `shutdown(Write)` sys call.
|
|
1301
1301
|
///
|
|
@@ -3,7 +3,7 @@ use crate::io::AsyncWrite;
|
|
|
3
3
|
use bytes::Buf;
|
|
4
4
|
use pin_project_lite::pin_project;
|
|
5
5
|
use std::future::Future;
|
|
6
|
-
use std::io;
|
|
6
|
+
use std::io::{self, IoSlice};
|
|
7
7
|
use std::marker::PhantomPinned;
|
|
8
8
|
use std::pin::Pin;
|
|
9
9
|
use std::task::{ready, Context, Poll};
|
|
@@ -42,13 +42,22 @@ where
|
|
|
42
42
|
type Output = io::Result<usize>;
|
|
43
43
|
|
|
44
44
|
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<usize>> {
|
|
45
|
+
const MAX_VECTOR_ELEMENTS: usize = 64;
|
|
46
|
+
|
|
45
47
|
let me = self.project();
|
|
46
48
|
|
|
47
49
|
if !me.buf.has_remaining() {
|
|
48
50
|
return Poll::Ready(Ok(0));
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
let n =
|
|
53
|
+
let n = if me.writer.is_write_vectored() {
|
|
54
|
+
let mut slices = [IoSlice::new(&[]); MAX_VECTOR_ELEMENTS];
|
|
55
|
+
let cnt = me.buf.chunks_vectored(&mut slices);
|
|
56
|
+
ready!(Pin::new(&mut *me.writer).poll_write_vectored(cx, &slices[..cnt]))?
|
|
57
|
+
} else {
|
|
58
|
+
ready!(Pin::new(&mut *me.writer).poll_write(cx, me.buf.chunk()))?
|
|
59
|
+
};
|
|
60
|
+
|
|
52
61
|
me.buf.advance(n);
|
|
53
62
|
Poll::Ready(Ok(n))
|
|
54
63
|
}
|
|
@@ -320,7 +320,7 @@
|
|
|
320
320
|
//! Beware though that this will pull in many extra dependencies that you may not
|
|
321
321
|
//! need.
|
|
322
322
|
//!
|
|
323
|
-
//! - `full`: Enables all features listed below except `test-util` and
|
|
323
|
+
//! - `full`: Enables all features listed below except `test-util` and unstable features.
|
|
324
324
|
//! - `rt`: Enables `tokio::spawn`, the current-thread scheduler,
|
|
325
325
|
//! and non-scheduler utilities.
|
|
326
326
|
//! - `rt-multi-thread`: Enables the heavier, multi-threaded, work-stealing scheduler.
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
//! `UdpSocket`, as well as (on Unix-like systems) `AsyncFd` and (on
|
|
331
331
|
//! FreeBSD) `PollAio`.
|
|
332
332
|
//! - `time`: Enables `tokio::time` types and allows the schedulers to enable
|
|
333
|
-
//! the built
|
|
333
|
+
//! the built-in timer.
|
|
334
334
|
//! - `process`: Enables `tokio::process` types.
|
|
335
335
|
//! - `macros`: Enables `#[tokio::main]` and `#[tokio::test]` macros.
|
|
336
336
|
//! - `sync`: Enables all `tokio::sync` types.
|
|
@@ -351,16 +351,10 @@
|
|
|
351
351
|
//! Some feature flags are only available when specifying the `tokio_unstable` flag:
|
|
352
352
|
//!
|
|
353
353
|
//! - `tracing`: Enables tracing events.
|
|
354
|
+
//! - `io-uring`: Enables `io-uring` (Linux only).
|
|
355
|
+
//! - `taskdump`: Enables `taskdump` (Linux only).
|
|
354
356
|
//!
|
|
355
|
-
//! Likewise,
|
|
356
|
-
//!
|
|
357
|
-
//! - [`task::Builder`]
|
|
358
|
-
//! - Some methods on [`task::JoinSet`]
|
|
359
|
-
//! - [`runtime::RuntimeMetrics`]
|
|
360
|
-
//! - [`runtime::Builder::on_task_spawn`]
|
|
361
|
-
//! - [`runtime::Builder::on_task_terminate`]
|
|
362
|
-
//! - [`runtime::Builder::unhandled_panic`]
|
|
363
|
-
//! - [`runtime::TaskMeta`]
|
|
357
|
+
//! Likewise, this flag enables access to unstable APIs.
|
|
364
358
|
//!
|
|
365
359
|
//! This flag enables **unstable** features. The public API of these features
|
|
366
360
|
//! may break in 1.x releases. To enable these features, the `--cfg
|
|
@@ -555,6 +549,11 @@ cfg_not_sync! {
|
|
|
555
549
|
mod sync;
|
|
556
550
|
}
|
|
557
551
|
|
|
552
|
+
// Currently, task module does not expose any public API outside `rt`
|
|
553
|
+
// feature, so we mark it in the docs. This happens only to docs to
|
|
554
|
+
// avoid introducing breaking changes by restricting the visibility
|
|
555
|
+
// of the task module.
|
|
556
|
+
#[cfg_attr(docsrs, doc(cfg(feature = "rt")))]
|
|
558
557
|
pub mod task;
|
|
559
558
|
cfg_rt! {
|
|
560
559
|
pub use task::spawn;
|
|
@@ -565,10 +564,6 @@ cfg_time! {
|
|
|
565
564
|
}
|
|
566
565
|
|
|
567
566
|
mod trace {
|
|
568
|
-
use std::future::Future;
|
|
569
|
-
use std::pin::Pin;
|
|
570
|
-
use std::task::{Context, Poll};
|
|
571
|
-
|
|
572
567
|
cfg_taskdump! {
|
|
573
568
|
pub(crate) use crate::runtime::task::trace::trace_leaf;
|
|
574
569
|
}
|
|
@@ -582,19 +577,8 @@ mod trace {
|
|
|
582
577
|
}
|
|
583
578
|
|
|
584
579
|
#[cfg_attr(not(feature = "sync"), allow(dead_code))]
|
|
585
|
-
pub(crate) fn async_trace_leaf()
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
impl Future for Trace {
|
|
589
|
-
type Output = ();
|
|
590
|
-
|
|
591
|
-
#[inline(always)]
|
|
592
|
-
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()> {
|
|
593
|
-
trace_leaf(cx)
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
Trace
|
|
580
|
+
pub(crate) async fn async_trace_leaf() {
|
|
581
|
+
std::future::poll_fn(trace_leaf).await
|
|
598
582
|
}
|
|
599
583
|
}
|
|
600
584
|
|
|
@@ -615,9 +615,7 @@ doc! {macro_rules! select {
|
|
|
615
615
|
|
|
616
616
|
// `tokio::macros::support` is a public, but doc(hidden) module
|
|
617
617
|
// including a re-export of all types needed by this macro.
|
|
618
|
-
use $crate::macros::support::Future;
|
|
619
618
|
use $crate::macros::support::Pin;
|
|
620
|
-
use $crate::macros::support::Poll::{Ready, Pending};
|
|
621
619
|
|
|
622
620
|
const BRANCHES: u32 = $crate::count!( $($count)* );
|
|
623
621
|
|
|
@@ -704,9 +702,9 @@ doc! {macro_rules! select {
|
|
|
704
702
|
let mut fut = unsafe { Pin::new_unchecked(fut) };
|
|
705
703
|
|
|
706
704
|
// Try polling it
|
|
707
|
-
let out = match Future::poll(fut, cx) {
|
|
708
|
-
Ready(out) => out,
|
|
709
|
-
Pending => {
|
|
705
|
+
let out = match $crate::macros::support::Future::poll(fut, cx) {
|
|
706
|
+
$crate::macros::support::Poll::Ready(out) => out,
|
|
707
|
+
$crate::macros::support::Poll::Pending => {
|
|
710
708
|
// Track that at least one future is
|
|
711
709
|
// still pending and continue polling.
|
|
712
710
|
is_pending = true;
|
|
@@ -727,7 +725,7 @@ doc! {macro_rules! select {
|
|
|
727
725
|
}
|
|
728
726
|
|
|
729
727
|
// The select is complete, return the value
|
|
730
|
-
return Ready($crate::select_variant!(__tokio_select_util::Out, ($($skip)*))(out));
|
|
728
|
+
return $crate::macros::support::Poll::Ready($crate::select_variant!(__tokio_select_util::Out, ($($skip)*))(out));
|
|
731
729
|
}
|
|
732
730
|
)*
|
|
733
731
|
_ => unreachable!("reaching this means there probably is an off by one bug"),
|
|
@@ -735,10 +733,10 @@ doc! {macro_rules! select {
|
|
|
735
733
|
}
|
|
736
734
|
|
|
737
735
|
if is_pending {
|
|
738
|
-
Pending
|
|
736
|
+
$crate::macros::support::Poll::Pending
|
|
739
737
|
} else {
|
|
740
738
|
// All branches have been disabled.
|
|
741
|
-
Ready(__tokio_select_util::Out::Disabled)
|
|
739
|
+
$crate::macros::support::Poll::Ready(__tokio_select_util::Out::Disabled)
|
|
742
740
|
}
|
|
743
741
|
}).await
|
|
744
742
|
};
|
|
@@ -429,17 +429,41 @@ impl TcpSocket {
|
|
|
429
429
|
/// > it. Rely on the `shutdown()`-followed-by-`read()`-eof technique instead.
|
|
430
430
|
/// >
|
|
431
431
|
/// > From [The ultimate `SO_LINGER` page, or: why is my tcp not reliable](https://blog.netherlabs.nl/articles/2009/01/18/the-ultimate-so_linger-page-or-why-is-my-tcp-not-reliable)
|
|
432
|
+
///
|
|
433
|
+
/// Although this method is deprecated, it will not be removed from Tokio.
|
|
434
|
+
///
|
|
435
|
+
/// Note that the special case of setting `SO_LINGER` to zero does not lead to blocking. Tokio
|
|
436
|
+
/// provides [`set_zero_linger`](Self::set_zero_linger) for this purpose.
|
|
432
437
|
#[deprecated = "`SO_LINGER` causes the socket to block the thread on drop"]
|
|
433
438
|
pub fn set_linger(&self, dur: Option<Duration>) -> io::Result<()> {
|
|
434
439
|
self.inner.set_linger(dur)
|
|
435
440
|
}
|
|
436
441
|
|
|
442
|
+
/// Sets a linger duration of zero on this socket by setting the `SO_LINGER` option.
|
|
443
|
+
///
|
|
444
|
+
/// This causes the connection to be forcefully aborted ("abortive close") when the socket is
|
|
445
|
+
/// dropped or closed. Instead of the normal TCP shutdown handshake (`FIN`/`ACK`), a TCP `RST`
|
|
446
|
+
/// (reset) segment is sent to the peer, and the socket immediately discards any unsent data
|
|
447
|
+
/// residing in the socket send buffer. This prevents the socket from entering the `TIME_WAIT`
|
|
448
|
+
/// state after closing it.
|
|
449
|
+
///
|
|
450
|
+
/// This is a destructive action. Any data currently buffered by the OS but not yet transmitted
|
|
451
|
+
/// will be lost. The peer will likely receive a "Connection Reset" error rather than a clean
|
|
452
|
+
/// end-of-stream.
|
|
453
|
+
///
|
|
454
|
+
/// See the documentation for [`set_linger`](Self::set_linger) for additional details on how
|
|
455
|
+
/// `SO_LINGER` works.
|
|
456
|
+
pub fn set_zero_linger(&self) -> io::Result<()> {
|
|
457
|
+
self.inner.set_linger(Some(Duration::ZERO))
|
|
458
|
+
}
|
|
459
|
+
|
|
437
460
|
/// Reads the linger duration for this socket by getting the `SO_LINGER`
|
|
438
461
|
/// option.
|
|
439
462
|
///
|
|
440
|
-
/// For more information about this option, see [`set_linger`].
|
|
463
|
+
/// For more information about this option, see [`set_zero_linger`] and [`set_linger`].
|
|
441
464
|
///
|
|
442
465
|
/// [`set_linger`]: TcpSocket::set_linger
|
|
466
|
+
/// [`set_zero_linger`]: TcpSocket::set_zero_linger
|
|
443
467
|
pub fn linger(&self) -> io::Result<Option<Duration>> {
|
|
444
468
|
self.inner.linger()
|
|
445
469
|
}
|