html-to-markdown 2.25.1 → 2.26.2
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/Cargo.toml +3 -0
- data/Gemfile.lock +2 -2
- data/README.md +8 -5
- data/ext/html-to-markdown-rb/native/Cargo.toml +1 -1
- data/lib/html_to_markdown/version.rb +1 -1
- data/rust-vendor/anyhow/.cargo-checksum.json +1 -1
- data/rust-vendor/anyhow/.cargo_vcs_info.json +1 -1
- data/rust-vendor/anyhow/.github/workflows/ci.yml +3 -4
- data/rust-vendor/anyhow/Cargo.lock +31 -111
- data/rust-vendor/anyhow/Cargo.toml +2 -5
- data/rust-vendor/anyhow/Cargo.toml.orig +4 -8
- data/rust-vendor/anyhow/build.rs +1 -14
- data/rust-vendor/anyhow/src/backtrace.rs +8 -370
- data/rust-vendor/anyhow/src/error.rs +12 -39
- data/rust-vendor/anyhow/src/fmt.rs +2 -2
- data/rust-vendor/anyhow/src/lib.rs +1 -1
- data/rust-vendor/async-trait/.cargo-checksum.json +1 -0
- data/rust-vendor/async-trait/.cargo_vcs_info.json +6 -0
- data/rust-vendor/async-trait/.github/FUNDING.yml +1 -0
- data/rust-vendor/async-trait/.github/workflows/ci.yml +109 -0
- data/rust-vendor/async-trait/Cargo.lock +453 -0
- data/rust-vendor/async-trait/Cargo.toml +91 -0
- data/rust-vendor/async-trait/Cargo.toml.orig +38 -0
- data/rust-vendor/async-trait/LICENSE-APACHE +176 -0
- data/rust-vendor/async-trait/README.md +205 -0
- data/rust-vendor/async-trait/src/args.rs +36 -0
- data/rust-vendor/async-trait/src/bound.rs +50 -0
- data/rust-vendor/async-trait/src/expand.rs +504 -0
- data/rust-vendor/async-trait/src/lib.rs +257 -0
- data/rust-vendor/async-trait/src/lifetime.rs +112 -0
- data/rust-vendor/async-trait/src/parse.rs +34 -0
- data/rust-vendor/async-trait/src/receiver.rs +169 -0
- data/rust-vendor/async-trait/src/verbatim.rs +34 -0
- data/rust-vendor/async-trait/tests/compiletest.rs +7 -0
- data/rust-vendor/async-trait/tests/executor/mod.rs +36 -0
- data/rust-vendor/async-trait/tests/test.rs +1728 -0
- data/rust-vendor/async-trait/tests/ui/arg-implementation-detail.rs +22 -0
- data/rust-vendor/async-trait/tests/ui/arg-implementation-detail.stderr +5 -0
- data/rust-vendor/async-trait/tests/ui/bare-trait-object.rs +15 -0
- data/rust-vendor/async-trait/tests/ui/bare-trait-object.stderr +15 -0
- data/rust-vendor/async-trait/tests/ui/consider-restricting.rs +26 -0
- data/rust-vendor/async-trait/tests/ui/consider-restricting.stderr +33 -0
- data/rust-vendor/async-trait/tests/ui/delimiter-span.rs +24 -0
- data/rust-vendor/async-trait/tests/ui/delimiter-span.stderr +21 -0
- data/rust-vendor/async-trait/tests/ui/lifetime-defined-here.rs +23 -0
- data/rust-vendor/async-trait/tests/ui/lifetime-defined-here.stderr +29 -0
- data/rust-vendor/async-trait/tests/ui/lifetime-span.rs +36 -0
- data/rust-vendor/async-trait/tests/ui/lifetime-span.stderr +33 -0
- data/rust-vendor/async-trait/tests/ui/missing-async-in-impl.rs +15 -0
- data/rust-vendor/async-trait/tests/ui/missing-async-in-impl.stderr +8 -0
- data/rust-vendor/async-trait/tests/ui/missing-async-in-trait.rs +15 -0
- data/rust-vendor/async-trait/tests/ui/missing-async-in-trait.stderr +8 -0
- data/rust-vendor/async-trait/tests/ui/missing-body.rs +15 -0
- data/rust-vendor/async-trait/tests/ui/missing-body.stderr +7 -0
- data/rust-vendor/async-trait/tests/ui/must-use.rs +21 -0
- data/rust-vendor/async-trait/tests/ui/must-use.stderr +23 -0
- data/rust-vendor/async-trait/tests/ui/no-attribute-macro.rs +13 -0
- data/rust-vendor/async-trait/tests/ui/no-attribute-macro.stderr +17 -0
- data/rust-vendor/async-trait/tests/ui/self-span.rs +30 -0
- data/rust-vendor/async-trait/tests/ui/self-span.stderr +32 -0
- data/rust-vendor/async-trait/tests/ui/send-not-implemented.rs +22 -0
- data/rust-vendor/async-trait/tests/ui/send-not-implemented.stderr +31 -0
- data/rust-vendor/async-trait/tests/ui/type-mismatch.rs +21 -0
- data/rust-vendor/async-trait/tests/ui/type-mismatch.stderr +11 -0
- data/rust-vendor/async-trait/tests/ui/unreachable.rs +20 -0
- data/rust-vendor/async-trait/tests/ui/unreachable.stderr +14 -0
- data/rust-vendor/async-trait/tests/ui/unsupported-self.rs +15 -0
- data/rust-vendor/async-trait/tests/ui/unsupported-self.stderr +5 -0
- data/rust-vendor/bumpalo/.cargo-checksum.json +1 -1
- data/rust-vendor/bumpalo/.cargo_vcs_info.json +1 -1
- data/rust-vendor/bumpalo/CHANGELOG.md +39 -0
- data/rust-vendor/bumpalo/Cargo.lock +1 -1
- data/rust-vendor/bumpalo/Cargo.toml +2 -2
- data/rust-vendor/bumpalo/Cargo.toml.orig +2 -2
- data/rust-vendor/bumpalo/src/boxed.rs +73 -25
- data/rust-vendor/bumpalo/src/collections/string.rs +41 -19
- data/rust-vendor/bumpalo/src/collections/vec.rs +27 -0
- data/rust-vendor/bumpalo/src/lib.rs +11 -0
- data/rust-vendor/futures/.cargo-checksum.json +1 -0
- data/rust-vendor/futures/.cargo_vcs_info.json +6 -0
- data/rust-vendor/futures/Cargo.lock +746 -0
- data/rust-vendor/futures/Cargo.toml +394 -0
- data/rust-vendor/futures/Cargo.toml.orig +65 -0
- data/rust-vendor/futures/LICENSE-APACHE +202 -0
- data/rust-vendor/futures/LICENSE-MIT +26 -0
- data/rust-vendor/futures/README.md +61 -0
- data/rust-vendor/futures/src/lib.rs +254 -0
- data/rust-vendor/futures/tests/_require_features.rs +13 -0
- data/rust-vendor/futures/tests/async_await_macros.rs +404 -0
- data/rust-vendor/futures/tests/auto_traits.rs +1899 -0
- data/rust-vendor/futures/tests/bilock.rs +104 -0
- data/rust-vendor/futures/tests/compat.rs +16 -0
- data/rust-vendor/futures/tests/eager_drop.rs +121 -0
- data/rust-vendor/futures/tests/eventual.rs +179 -0
- data/rust-vendor/futures/tests/future_abortable.rs +44 -0
- data/rust-vendor/futures/tests/future_basic_combinators.rs +104 -0
- data/rust-vendor/futures/tests/future_fuse.rs +12 -0
- data/rust-vendor/futures/tests/future_inspect.rs +16 -0
- data/rust-vendor/futures/tests/future_join.rs +32 -0
- data/rust-vendor/futures/tests/future_join_all.rs +40 -0
- data/rust-vendor/futures/tests/future_obj.rs +33 -0
- data/rust-vendor/futures/tests/future_select_all.rs +25 -0
- data/rust-vendor/futures/tests/future_select_ok.rs +30 -0
- data/rust-vendor/futures/tests/future_shared.rs +273 -0
- data/rust-vendor/futures/tests/future_try_flatten_stream.rs +83 -0
- data/rust-vendor/futures/tests/future_try_join_all.rs +44 -0
- data/rust-vendor/futures/tests/io_buf_reader.rs +431 -0
- data/rust-vendor/futures/tests/io_buf_writer.rs +239 -0
- data/rust-vendor/futures/tests/io_cursor.rs +30 -0
- data/rust-vendor/futures/tests/io_line_writer.rs +73 -0
- data/rust-vendor/futures/tests/io_lines.rs +84 -0
- data/rust-vendor/futures/tests/io_read.rs +64 -0
- data/rust-vendor/futures/tests/io_read_exact.rs +17 -0
- data/rust-vendor/futures/tests/io_read_line.rs +101 -0
- data/rust-vendor/futures/tests/io_read_to_end.rs +65 -0
- data/rust-vendor/futures/tests/io_read_to_string.rs +44 -0
- data/rust-vendor/futures/tests/io_read_until.rs +60 -0
- data/rust-vendor/futures/tests/io_window.rs +30 -0
- data/rust-vendor/futures/tests/io_write.rs +65 -0
- data/rust-vendor/futures/tests/lock_mutex.rs +69 -0
- data/rust-vendor/futures/tests/macro_comma_support.rs +43 -0
- data/rust-vendor/futures/tests/object_safety.rs +49 -0
- data/rust-vendor/futures/tests/oneshot.rs +78 -0
- data/rust-vendor/futures/tests/ready_queue.rs +148 -0
- data/rust-vendor/futures/tests/recurse.rs +25 -0
- data/rust-vendor/futures/tests/sink.rs +554 -0
- data/rust-vendor/futures/tests/sink_fanout.rs +24 -0
- data/rust-vendor/futures/tests/stream.rs +577 -0
- data/rust-vendor/futures/tests/stream_abortable.rs +46 -0
- data/rust-vendor/futures/tests/stream_buffer_unordered.rs +73 -0
- data/rust-vendor/futures/tests/stream_catch_unwind.rs +27 -0
- data/rust-vendor/futures/tests/stream_futures_ordered.rs +172 -0
- data/rust-vendor/futures/tests/stream_futures_unordered.rs +431 -0
- data/rust-vendor/futures/tests/stream_into_async_read.rs +94 -0
- data/rust-vendor/futures/tests/stream_peekable.rs +58 -0
- data/rust-vendor/futures/tests/stream_select_all.rs +197 -0
- data/rust-vendor/futures/tests/stream_select_next_some.rs +86 -0
- data/rust-vendor/futures/tests/stream_split.rs +57 -0
- data/rust-vendor/futures/tests/stream_try_stream.rs +183 -0
- data/rust-vendor/futures/tests/stream_unfold.rs +32 -0
- data/rust-vendor/futures/tests/task_arc_wake.rs +79 -0
- data/rust-vendor/futures/tests/task_atomic_waker.rs +48 -0
- data/rust-vendor/futures/tests/test_macro.rs +20 -0
- data/rust-vendor/futures/tests/try_join.rs +35 -0
- data/rust-vendor/futures/tests_disabled/all.rs +400 -0
- data/rust-vendor/futures/tests_disabled/stream.rs +368 -0
- data/rust-vendor/futures-channel/.cargo-checksum.json +1 -0
- data/rust-vendor/futures-channel/.cargo_vcs_info.json +6 -0
- data/rust-vendor/futures-channel/Cargo.lock +23 -0
- data/rust-vendor/futures-channel/Cargo.toml +97 -0
- data/rust-vendor/futures-channel/Cargo.toml.orig +38 -0
- data/rust-vendor/futures-channel/LICENSE-APACHE +202 -0
- data/rust-vendor/futures-channel/LICENSE-MIT +26 -0
- data/rust-vendor/futures-channel/README.md +23 -0
- data/rust-vendor/futures-channel/benches/sync_mpsc.rs +135 -0
- data/rust-vendor/futures-channel/src/lib.rs +38 -0
- data/rust-vendor/futures-channel/src/lock.rs +102 -0
- data/rust-vendor/futures-channel/src/mpsc/mod.rs +1468 -0
- data/rust-vendor/futures-channel/src/mpsc/queue.rs +177 -0
- data/rust-vendor/futures-channel/src/mpsc/sink_impl.rs +73 -0
- data/rust-vendor/futures-channel/src/oneshot.rs +488 -0
- data/rust-vendor/futures-channel/tests/channel.rs +66 -0
- data/rust-vendor/futures-channel/tests/mpsc-close.rs +332 -0
- data/rust-vendor/futures-channel/tests/mpsc-size_hint.rs +40 -0
- data/rust-vendor/futures-channel/tests/mpsc.rs +703 -0
- data/rust-vendor/futures-channel/tests/oneshot.rs +256 -0
- data/rust-vendor/futures-core/.cargo-checksum.json +1 -0
- data/rust-vendor/futures-core/.cargo_vcs_info.json +6 -0
- data/rust-vendor/futures-core/Cargo.lock +16 -0
- data/rust-vendor/futures-core/Cargo.toml +66 -0
- data/rust-vendor/futures-core/Cargo.toml.orig +35 -0
- data/rust-vendor/futures-core/LICENSE-APACHE +202 -0
- data/rust-vendor/futures-core/LICENSE-MIT +26 -0
- data/rust-vendor/futures-core/README.md +23 -0
- data/rust-vendor/futures-core/src/future.rs +113 -0
- data/rust-vendor/futures-core/src/lib.rs +27 -0
- data/rust-vendor/futures-core/src/stream.rs +245 -0
- data/rust-vendor/futures-core/src/task/__internal/atomic_waker.rs +423 -0
- data/rust-vendor/futures-core/src/task/__internal/mod.rs +7 -0
- data/rust-vendor/futures-core/src/task/mod.rs +10 -0
- data/rust-vendor/futures-core/src/task/poll.rs +15 -0
- data/rust-vendor/futures-executor/.cargo-checksum.json +1 -0
- data/rust-vendor/futures-executor/.cargo_vcs_info.json +6 -0
- data/rust-vendor/futures-executor/Cargo.lock +48 -0
- data/rust-vendor/futures-executor/Cargo.toml +82 -0
- data/rust-vendor/futures-executor/Cargo.toml.orig +32 -0
- data/rust-vendor/futures-executor/LICENSE-APACHE +202 -0
- data/rust-vendor/futures-executor/LICENSE-MIT +26 -0
- data/rust-vendor/futures-executor/README.md +23 -0
- data/rust-vendor/futures-executor/benches/thread_notify.rs +109 -0
- data/rust-vendor/futures-executor/src/enter.rs +80 -0
- data/rust-vendor/futures-executor/src/lib.rs +73 -0
- data/rust-vendor/futures-executor/src/local_pool.rs +401 -0
- data/rust-vendor/futures-executor/src/thread_pool.rs +377 -0
- data/rust-vendor/futures-executor/src/unpark_mutex.rs +137 -0
- data/rust-vendor/futures-executor/tests/local_pool.rs +497 -0
- data/rust-vendor/futures-io/.cargo-checksum.json +1 -0
- data/rust-vendor/futures-io/.cargo_vcs_info.json +6 -0
- data/rust-vendor/futures-io/Cargo.lock +6 -0
- data/rust-vendor/futures-io/Cargo.toml +58 -0
- data/rust-vendor/futures-io/Cargo.toml.orig +30 -0
- data/rust-vendor/futures-io/LICENSE-APACHE +202 -0
- data/rust-vendor/futures-io/LICENSE-MIT +26 -0
- data/rust-vendor/futures-io/README.md +23 -0
- data/rust-vendor/futures-io/src/lib.rs +561 -0
- data/rust-vendor/futures-macro/.cargo-checksum.json +1 -0
- data/rust-vendor/futures-macro/.cargo_vcs_info.json +6 -0
- data/rust-vendor/futures-macro/Cargo.lock +47 -0
- data/rust-vendor/futures-macro/Cargo.toml +57 -0
- data/rust-vendor/futures-macro/Cargo.toml.orig +25 -0
- data/rust-vendor/futures-macro/LICENSE-APACHE +202 -0
- data/rust-vendor/futures-macro/LICENSE-MIT +26 -0
- data/rust-vendor/futures-macro/src/executor.rs +56 -0
- data/rust-vendor/futures-macro/src/join.rs +144 -0
- data/rust-vendor/futures-macro/src/lib.rs +55 -0
- data/rust-vendor/futures-macro/src/select.rs +330 -0
- data/rust-vendor/futures-macro/src/stream_select.rs +113 -0
- data/rust-vendor/futures-sink/.cargo-checksum.json +1 -0
- data/rust-vendor/futures-sink/.cargo_vcs_info.json +6 -0
- data/rust-vendor/futures-sink/Cargo.lock +6 -0
- data/rust-vendor/futures-sink/Cargo.toml +54 -0
- data/rust-vendor/futures-sink/Cargo.toml.orig +25 -0
- data/rust-vendor/futures-sink/LICENSE-APACHE +202 -0
- data/rust-vendor/futures-sink/LICENSE-MIT +26 -0
- data/rust-vendor/futures-sink/README.md +23 -0
- data/rust-vendor/futures-sink/src/lib.rs +240 -0
- data/rust-vendor/futures-task/.cargo-checksum.json +1 -0
- data/rust-vendor/futures-task/.cargo_vcs_info.json +6 -0
- data/rust-vendor/futures-task/Cargo.lock +6 -0
- data/rust-vendor/futures-task/Cargo.toml +58 -0
- data/rust-vendor/futures-task/Cargo.toml.orig +33 -0
- data/rust-vendor/futures-task/LICENSE-APACHE +202 -0
- data/rust-vendor/futures-task/LICENSE-MIT +26 -0
- data/rust-vendor/futures-task/README.md +23 -0
- data/rust-vendor/futures-task/src/arc_wake.rs +49 -0
- data/rust-vendor/futures-task/src/future_obj.rs +335 -0
- data/rust-vendor/futures-task/src/lib.rs +50 -0
- data/rust-vendor/futures-task/src/noop_waker.rs +63 -0
- data/rust-vendor/futures-task/src/spawn.rs +192 -0
- data/rust-vendor/futures-task/src/waker.rs +60 -0
- data/rust-vendor/futures-task/src/waker_ref.rs +66 -0
- data/rust-vendor/futures-util/.cargo-checksum.json +1 -0
- data/rust-vendor/futures-util/.cargo_vcs_info.json +6 -0
- data/rust-vendor/futures-util/Cargo.lock +693 -0
- data/rust-vendor/futures-util/Cargo.toml +181 -0
- data/rust-vendor/futures-util/Cargo.toml.orig +65 -0
- data/rust-vendor/futures-util/LICENSE-APACHE +202 -0
- data/rust-vendor/futures-util/LICENSE-MIT +26 -0
- data/rust-vendor/futures-util/README.md +23 -0
- data/rust-vendor/futures-util/benches/bilock.rs +68 -0
- data/rust-vendor/futures-util/benches/flatten_unordered.rs +58 -0
- data/rust-vendor/futures-util/benches/futures_unordered.rs +43 -0
- data/rust-vendor/futures-util/benches/select.rs +35 -0
- data/rust-vendor/futures-util/src/abortable.rs +209 -0
- data/rust-vendor/futures-util/src/async_await/join_mod.rs +110 -0
- data/rust-vendor/futures-util/src/async_await/mod.rs +60 -0
- data/rust-vendor/futures-util/src/async_await/pending.rs +43 -0
- data/rust-vendor/futures-util/src/async_await/poll.rs +39 -0
- data/rust-vendor/futures-util/src/async_await/random.rs +54 -0
- data/rust-vendor/futures-util/src/async_await/select_mod.rs +340 -0
- data/rust-vendor/futures-util/src/async_await/stream_select_mod.rs +39 -0
- data/rust-vendor/futures-util/src/compat/compat01as03.rs +455 -0
- data/rust-vendor/futures-util/src/compat/compat03as01.rs +268 -0
- data/rust-vendor/futures-util/src/compat/executor.rs +86 -0
- data/rust-vendor/futures-util/src/compat/mod.rs +22 -0
- data/rust-vendor/futures-util/src/fns.rs +372 -0
- data/rust-vendor/futures-util/src/future/abortable.rs +19 -0
- data/rust-vendor/futures-util/src/future/always_ready.rs +62 -0
- data/rust-vendor/futures-util/src/future/either.rs +314 -0
- data/rust-vendor/futures-util/src/future/future/catch_unwind.rs +39 -0
- data/rust-vendor/futures-util/src/future/future/flatten.rs +153 -0
- data/rust-vendor/futures-util/src/future/future/fuse.rs +92 -0
- data/rust-vendor/futures-util/src/future/future/map.rs +66 -0
- data/rust-vendor/futures-util/src/future/future/mod.rs +603 -0
- data/rust-vendor/futures-util/src/future/future/remote_handle.rs +127 -0
- data/rust-vendor/futures-util/src/future/future/shared.rs +430 -0
- data/rust-vendor/futures-util/src/future/join.rs +217 -0
- data/rust-vendor/futures-util/src/future/join_all.rs +167 -0
- data/rust-vendor/futures-util/src/future/lazy.rs +60 -0
- data/rust-vendor/futures-util/src/future/maybe_done.rs +105 -0
- data/rust-vendor/futures-util/src/future/mod.rs +134 -0
- data/rust-vendor/futures-util/src/future/option.rs +64 -0
- data/rust-vendor/futures-util/src/future/pending.rs +55 -0
- data/rust-vendor/futures-util/src/future/poll_fn.rs +58 -0
- data/rust-vendor/futures-util/src/future/poll_immediate.rs +131 -0
- data/rust-vendor/futures-util/src/future/ready.rs +82 -0
- data/rust-vendor/futures-util/src/future/select.rs +133 -0
- data/rust-vendor/futures-util/src/future/select_all.rs +75 -0
- data/rust-vendor/futures-util/src/future/select_ok.rs +85 -0
- data/rust-vendor/futures-util/src/future/try_future/into_future.rs +36 -0
- data/rust-vendor/futures-util/src/future/try_future/mod.rs +625 -0
- data/rust-vendor/futures-util/src/future/try_future/try_flatten.rs +162 -0
- data/rust-vendor/futures-util/src/future/try_future/try_flatten_err.rs +62 -0
- data/rust-vendor/futures-util/src/future/try_join.rs +256 -0
- data/rust-vendor/futures-util/src/future/try_join_all.rs +201 -0
- data/rust-vendor/futures-util/src/future/try_maybe_done.rs +92 -0
- data/rust-vendor/futures-util/src/future/try_select.rs +85 -0
- data/rust-vendor/futures-util/src/io/allow_std.rs +202 -0
- data/rust-vendor/futures-util/src/io/buf_reader.rs +264 -0
- data/rust-vendor/futures-util/src/io/buf_writer.rs +229 -0
- data/rust-vendor/futures-util/src/io/chain.rs +142 -0
- data/rust-vendor/futures-util/src/io/close.rs +28 -0
- data/rust-vendor/futures-util/src/io/copy.rs +58 -0
- data/rust-vendor/futures-util/src/io/copy_buf.rs +78 -0
- data/rust-vendor/futures-util/src/io/copy_buf_abortable.rs +124 -0
- data/rust-vendor/futures-util/src/io/cursor.rs +234 -0
- data/rust-vendor/futures-util/src/io/empty.rs +59 -0
- data/rust-vendor/futures-util/src/io/fill_buf.rs +47 -0
- data/rust-vendor/futures-util/src/io/flush.rs +31 -0
- data/rust-vendor/futures-util/src/io/into_sink.rs +82 -0
- data/rust-vendor/futures-util/src/io/line_writer.rs +155 -0
- data/rust-vendor/futures-util/src/io/lines.rs +50 -0
- data/rust-vendor/futures-util/src/io/mod.rs +833 -0
- data/rust-vendor/futures-util/src/io/read.rs +30 -0
- data/rust-vendor/futures-util/src/io/read_exact.rs +42 -0
- data/rust-vendor/futures-util/src/io/read_line.rs +77 -0
- data/rust-vendor/futures-util/src/io/read_to_end.rs +90 -0
- data/rust-vendor/futures-util/src/io/read_to_string.rs +60 -0
- data/rust-vendor/futures-util/src/io/read_until.rs +60 -0
- data/rust-vendor/futures-util/src/io/read_vectored.rs +30 -0
- data/rust-vendor/futures-util/src/io/repeat.rs +66 -0
- data/rust-vendor/futures-util/src/io/seek.rs +30 -0
- data/rust-vendor/futures-util/src/io/sink.rs +67 -0
- data/rust-vendor/futures-util/src/io/split.rs +129 -0
- data/rust-vendor/futures-util/src/io/take.rs +125 -0
- data/rust-vendor/futures-util/src/io/window.rs +104 -0
- data/rust-vendor/futures-util/src/io/write.rs +30 -0
- data/rust-vendor/futures-util/src/io/write_all.rs +43 -0
- data/rust-vendor/futures-util/src/io/write_all_vectored.rs +195 -0
- data/rust-vendor/futures-util/src/io/write_vectored.rs +30 -0
- data/rust-vendor/futures-util/src/lib.rs +332 -0
- data/rust-vendor/futures-util/src/lock/bilock.rs +297 -0
- data/rust-vendor/futures-util/src/lock/mod.rs +27 -0
- data/rust-vendor/futures-util/src/lock/mutex.rs +560 -0
- data/rust-vendor/futures-util/src/macros.rs +31 -0
- data/rust-vendor/futures-util/src/never.rs +18 -0
- data/rust-vendor/futures-util/src/sink/buffer.rs +105 -0
- data/rust-vendor/futures-util/src/sink/close.rs +32 -0
- data/rust-vendor/futures-util/src/sink/drain.rs +59 -0
- data/rust-vendor/futures-util/src/sink/err_into.rs +57 -0
- data/rust-vendor/futures-util/src/sink/fanout.rs +111 -0
- data/rust-vendor/futures-util/src/sink/feed.rs +43 -0
- data/rust-vendor/futures-util/src/sink/flush.rs +36 -0
- data/rust-vendor/futures-util/src/sink/map_err.rs +65 -0
- data/rust-vendor/futures-util/src/sink/mod.rs +344 -0
- data/rust-vendor/futures-util/src/sink/send.rs +41 -0
- data/rust-vendor/futures-util/src/sink/send_all.rs +100 -0
- data/rust-vendor/futures-util/src/sink/unfold.rs +92 -0
- data/rust-vendor/futures-util/src/sink/with.rs +145 -0
- data/rust-vendor/futures-util/src/sink/with_flat_map.rs +127 -0
- data/rust-vendor/futures-util/src/stream/abortable.rs +19 -0
- data/rust-vendor/futures-util/src/stream/empty.rs +45 -0
- data/rust-vendor/futures-util/src/stream/futures_ordered.rs +260 -0
- data/rust-vendor/futures-util/src/stream/futures_unordered/abort.rs +12 -0
- data/rust-vendor/futures-util/src/stream/futures_unordered/iter.rs +172 -0
- data/rust-vendor/futures-util/src/stream/futures_unordered/mod.rs +674 -0
- data/rust-vendor/futures-util/src/stream/futures_unordered/ready_to_run_queue.rs +113 -0
- data/rust-vendor/futures-util/src/stream/futures_unordered/task.rs +214 -0
- data/rust-vendor/futures-util/src/stream/iter.rs +66 -0
- data/rust-vendor/futures-util/src/stream/mod.rs +148 -0
- data/rust-vendor/futures-util/src/stream/once.rs +67 -0
- data/rust-vendor/futures-util/src/stream/pending.rs +45 -0
- data/rust-vendor/futures-util/src/stream/poll_fn.rs +57 -0
- data/rust-vendor/futures-util/src/stream/poll_immediate.rs +80 -0
- data/rust-vendor/futures-util/src/stream/repeat.rs +58 -0
- data/rust-vendor/futures-util/src/stream/repeat_with.rs +93 -0
- data/rust-vendor/futures-util/src/stream/select.rs +117 -0
- data/rust-vendor/futures-util/src/stream/select_all.rs +249 -0
- data/rust-vendor/futures-util/src/stream/select_with_strategy.rs +304 -0
- data/rust-vendor/futures-util/src/stream/stream/all.rs +93 -0
- data/rust-vendor/futures-util/src/stream/stream/any.rs +93 -0
- data/rust-vendor/futures-util/src/stream/stream/buffer_unordered.rs +120 -0
- data/rust-vendor/futures-util/src/stream/stream/buffered.rs +118 -0
- data/rust-vendor/futures-util/src/stream/stream/catch_unwind.rs +62 -0
- data/rust-vendor/futures-util/src/stream/stream/chain.rs +76 -0
- data/rust-vendor/futures-util/src/stream/stream/chunks.rs +103 -0
- data/rust-vendor/futures-util/src/stream/stream/collect.rs +56 -0
- data/rust-vendor/futures-util/src/stream/stream/concat.rs +62 -0
- data/rust-vendor/futures-util/src/stream/stream/count.rs +53 -0
- data/rust-vendor/futures-util/src/stream/stream/cycle.rs +67 -0
- data/rust-vendor/futures-util/src/stream/stream/enumerate.rs +64 -0
- data/rust-vendor/futures-util/src/stream/stream/filter.rs +117 -0
- data/rust-vendor/futures-util/src/stream/stream/filter_map.rs +111 -0
- data/rust-vendor/futures-util/src/stream/stream/flatten.rs +73 -0
- data/rust-vendor/futures-util/src/stream/stream/flatten_unordered.rs +531 -0
- data/rust-vendor/futures-util/src/stream/stream/fold.rs +88 -0
- data/rust-vendor/futures-util/src/stream/stream/for_each.rs +78 -0
- data/rust-vendor/futures-util/src/stream/stream/for_each_concurrent.rs +119 -0
- data/rust-vendor/futures-util/src/stream/stream/forward.rs +75 -0
- data/rust-vendor/futures-util/src/stream/stream/fuse.rs +75 -0
- data/rust-vendor/futures-util/src/stream/stream/into_future.rs +90 -0
- data/rust-vendor/futures-util/src/stream/stream/map.rs +77 -0
- data/rust-vendor/futures-util/src/stream/stream/mod.rs +1697 -0
- data/rust-vendor/futures-util/src/stream/stream/next.rs +34 -0
- data/rust-vendor/futures-util/src/stream/stream/peek.rs +441 -0
- data/rust-vendor/futures-util/src/stream/stream/ready_chunks.rs +93 -0
- data/rust-vendor/futures-util/src/stream/stream/scan.rs +128 -0
- data/rust-vendor/futures-util/src/stream/stream/select_next_some.rs +42 -0
- data/rust-vendor/futures-util/src/stream/stream/skip.rs +70 -0
- data/rust-vendor/futures-util/src/stream/stream/skip_while.rs +124 -0
- data/rust-vendor/futures-util/src/stream/stream/split.rs +224 -0
- data/rust-vendor/futures-util/src/stream/stream/take.rs +86 -0
- data/rust-vendor/futures-util/src/stream/stream/take_until.rs +170 -0
- data/rust-vendor/futures-util/src/stream/stream/take_while.rs +124 -0
- data/rust-vendor/futures-util/src/stream/stream/then.rs +101 -0
- data/rust-vendor/futures-util/src/stream/stream/unzip.rs +63 -0
- data/rust-vendor/futures-util/src/stream/stream/zip.rs +128 -0
- data/rust-vendor/futures-util/src/stream/try_stream/and_then.rs +105 -0
- data/rust-vendor/futures-util/src/stream/try_stream/into_async_read.rs +166 -0
- data/rust-vendor/futures-util/src/stream/try_stream/into_stream.rs +52 -0
- data/rust-vendor/futures-util/src/stream/try_stream/mod.rs +1254 -0
- data/rust-vendor/futures-util/src/stream/try_stream/or_else.rs +109 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_all.rs +98 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_any.rs +98 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_buffer_unordered.rs +86 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_buffered.rs +87 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_chunks.rs +132 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_collect.rs +52 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_concat.rs +51 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_filter.rs +112 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_filter_map.rs +106 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_flatten.rs +84 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_flatten_unordered.rs +176 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_fold.rs +93 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_for_each.rs +68 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_for_each_concurrent.rs +132 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_next.rs +34 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_ready_chunks.rs +126 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_skip_while.rs +120 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_take_while.rs +129 -0
- data/rust-vendor/futures-util/src/stream/try_stream/try_unfold.rs +122 -0
- data/rust-vendor/futures-util/src/stream/unfold.rs +119 -0
- data/rust-vendor/futures-util/src/task/mod.rs +40 -0
- data/rust-vendor/futures-util/src/task/spawn.rs +169 -0
- data/rust-vendor/futures-util/src/unfold_state.rs +39 -0
- data/rust-vendor/html-to-markdown-rs/Cargo.toml +2 -2
- data/rust-vendor/html-to-markdown-rs/src/convert_api.rs +5 -1
- data/rust-vendor/html-to-markdown-rs/src/converter/block/paragraph.rs +1 -0
- data/rust-vendor/html-to-markdown-rs/src/converter/context.rs +5 -0
- data/rust-vendor/html-to-markdown-rs/src/converter/text_node.rs +6 -1
- data/rust-vendor/html-to-markdown-rs/src/converter/visitor_hooks.rs +9 -3
- data/rust-vendor/html-to-markdown-rs/tests/convert_with_metadata_no_frontmatter.rs +100 -0
- data/rust-vendor/html-to-markdown-rs/tests/issue_212_regressions.rs +63 -0
- data/rust-vendor/html-to-markdown-rs/tests/visitor_integration_test.rs +58 -0
- data/rust-vendor/html5ever/.cargo-checksum.json +1 -1
- data/rust-vendor/html5ever/.cargo_vcs_info.json +1 -1
- data/rust-vendor/html5ever/Cargo.lock +216 -128
- data/rust-vendor/html5ever/Cargo.toml +11 -6
- data/rust-vendor/html5ever/Cargo.toml.orig +1 -0
- data/rust-vendor/html5ever/examples/arena.rs +30 -1
- data/rust-vendor/html5ever/src/driver.rs +19 -5
- data/rust-vendor/html5ever/src/encoding.rs +173 -0
- data/rust-vendor/html5ever/src/lib.rs +1 -0
- data/rust-vendor/html5ever/src/serialize/mod.rs +2 -2
- data/rust-vendor/html5ever/src/tokenizer/interface.rs +42 -4
- data/rust-vendor/html5ever/src/tokenizer/mod.rs +24 -1
- data/rust-vendor/html5ever/src/tokenizer/states.rs +34 -0
- data/rust-vendor/html5ever/src/tree_builder/mod.rs +8 -13
- data/rust-vendor/html5ever/src/tree_builder/rules.rs +131 -153
- data/rust-vendor/html5ever/src/tree_builder/tag_sets.rs +1 -6
- data/rust-vendor/html5ever/src/tree_builder/types.rs +22 -2
- data/rust-vendor/html5ever/tests/driver.rs +111 -0
- data/rust-vendor/js-sys/.cargo-checksum.json +1 -1
- data/rust-vendor/js-sys/.cargo_vcs_info.json +1 -1
- data/rust-vendor/js-sys/Cargo.lock +19 -19
- data/rust-vendor/js-sys/Cargo.toml +7 -3
- data/rust-vendor/js-sys/Cargo.toml.orig +7 -3
- data/rust-vendor/js-sys/README.md +2 -2
- data/rust-vendor/js-sys/src/Temporal.rs +2990 -663
- data/rust-vendor/js-sys/src/lib.rs +7485 -731
- data/rust-vendor/linux-raw-sys/.cargo-checksum.json +1 -1
- data/rust-vendor/linux-raw-sys/.cargo_vcs_info.json +1 -1
- data/rust-vendor/linux-raw-sys/Cargo.lock +3 -3
- data/rust-vendor/linux-raw-sys/Cargo.toml +3 -1
- data/rust-vendor/linux-raw-sys/Cargo.toml.orig +3 -1
- data/rust-vendor/linux-raw-sys/src/aarch64/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/aarch64/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/aarch64/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/aarch64/if_tun.rs +319 -0
- data/rust-vendor/linux-raw-sys/src/aarch64/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/aarch64/ioctl.rs +0 -1
- data/rust-vendor/linux-raw-sys/src/aarch64/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/aarch64/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/aarch64/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/aarch64/ptrace.rs +2 -0
- data/rust-vendor/linux-raw-sys/src/aarch64/vm_sockets.rs +111 -0
- data/rust-vendor/linux-raw-sys/src/aarch64/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/arm/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/arm/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/arm/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/arm/if_tun.rs +317 -0
- data/rust-vendor/linux-raw-sys/src/arm/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/arm/ioctl.rs +0 -1
- data/rust-vendor/linux-raw-sys/src/arm/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/arm/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/arm/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/arm/vm_sockets.rs +108 -0
- data/rust-vendor/linux-raw-sys/src/arm/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/csky/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/csky/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/csky/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/csky/if_tun.rs +317 -0
- data/rust-vendor/linux-raw-sys/src/csky/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/csky/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/csky/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/csky/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/csky/vm_sockets.rs +108 -0
- data/rust-vendor/linux-raw-sys/src/csky/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/auxvec.rs +30 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/bootparam.rs +3 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/btrfs.rs +1935 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/elf_uapi.rs +652 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/errno.rs +135 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/general.rs +3284 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/if_arp.rs +2793 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/if_ether.rs +168 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/if_packet.rs +309 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/if_tun.rs +317 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/image.rs +3 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/io_uring.rs +1489 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/ioctl.rs +3 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/landlock.rs +102 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/loop_device.rs +132 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/mempolicy.rs +175 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/net.rs +3487 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/netlink.rs +5606 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/prctl.rs +270 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/ptrace.rs +1091 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/system.rs +100 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/vm_sockets.rs +108 -0
- data/rust-vendor/linux-raw-sys/src/hexagon/xdp.rs +192 -0
- data/rust-vendor/linux-raw-sys/src/lib.rs +329 -0
- data/rust-vendor/linux-raw-sys/src/loongarch64/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/loongarch64/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/loongarch64/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/loongarch64/if_tun.rs +319 -0
- data/rust-vendor/linux-raw-sys/src/loongarch64/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/loongarch64/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/loongarch64/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/loongarch64/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/loongarch64/vm_sockets.rs +111 -0
- data/rust-vendor/linux-raw-sys/src/loongarch64/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/m68k/auxvec.rs +30 -0
- data/rust-vendor/linux-raw-sys/src/m68k/bootparam.rs +3 -0
- data/rust-vendor/linux-raw-sys/src/m68k/btrfs.rs +1935 -0
- data/rust-vendor/linux-raw-sys/src/m68k/elf_uapi.rs +652 -0
- data/rust-vendor/linux-raw-sys/src/m68k/errno.rs +135 -0
- data/rust-vendor/linux-raw-sys/src/m68k/general.rs +3379 -0
- data/rust-vendor/linux-raw-sys/src/m68k/if_arp.rs +2793 -0
- data/rust-vendor/linux-raw-sys/src/m68k/if_ether.rs +168 -0
- data/rust-vendor/linux-raw-sys/src/m68k/if_packet.rs +309 -0
- data/rust-vendor/linux-raw-sys/src/m68k/if_tun.rs +317 -0
- data/rust-vendor/linux-raw-sys/src/m68k/image.rs +3 -0
- data/rust-vendor/linux-raw-sys/src/m68k/io_uring.rs +1489 -0
- data/rust-vendor/linux-raw-sys/src/m68k/ioctl.rs +1501 -0
- data/rust-vendor/linux-raw-sys/src/m68k/landlock.rs +102 -0
- data/rust-vendor/linux-raw-sys/src/m68k/loop_device.rs +132 -0
- data/rust-vendor/linux-raw-sys/src/m68k/mempolicy.rs +175 -0
- data/rust-vendor/linux-raw-sys/src/m68k/net.rs +3487 -0
- data/rust-vendor/linux-raw-sys/src/m68k/netlink.rs +5606 -0
- data/rust-vendor/linux-raw-sys/src/m68k/prctl.rs +270 -0
- data/rust-vendor/linux-raw-sys/src/m68k/ptrace.rs +1019 -0
- data/rust-vendor/linux-raw-sys/src/m68k/system.rs +100 -0
- data/rust-vendor/linux-raw-sys/src/m68k/vm_sockets.rs +108 -0
- data/rust-vendor/linux-raw-sys/src/m68k/xdp.rs +192 -0
- data/rust-vendor/linux-raw-sys/src/mips/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/mips/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/mips/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/mips/if_tun.rs +327 -0
- data/rust-vendor/linux-raw-sys/src/mips/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/mips/ioctl.rs +0 -1
- data/rust-vendor/linux-raw-sys/src/mips/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/mips/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/mips/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/mips/vm_sockets.rs +118 -0
- data/rust-vendor/linux-raw-sys/src/mips/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/mips32r6/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/mips32r6/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/mips32r6/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/mips32r6/if_tun.rs +327 -0
- data/rust-vendor/linux-raw-sys/src/mips32r6/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/mips32r6/ioctl.rs +0 -1
- data/rust-vendor/linux-raw-sys/src/mips32r6/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/mips32r6/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/mips32r6/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/mips32r6/vm_sockets.rs +118 -0
- data/rust-vendor/linux-raw-sys/src/mips32r6/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/mips64/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/mips64/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/mips64/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/mips64/if_tun.rs +329 -0
- data/rust-vendor/linux-raw-sys/src/mips64/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/mips64/ioctl.rs +0 -1
- data/rust-vendor/linux-raw-sys/src/mips64/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/mips64/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/mips64/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/mips64/vm_sockets.rs +121 -0
- data/rust-vendor/linux-raw-sys/src/mips64/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/mips64r6/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/mips64r6/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/mips64r6/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/mips64r6/if_tun.rs +329 -0
- data/rust-vendor/linux-raw-sys/src/mips64r6/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/mips64r6/ioctl.rs +0 -1
- data/rust-vendor/linux-raw-sys/src/mips64r6/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/mips64r6/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/mips64r6/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/mips64r6/vm_sockets.rs +121 -0
- data/rust-vendor/linux-raw-sys/src/mips64r6/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/powerpc/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/powerpc/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/powerpc/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/powerpc/if_tun.rs +323 -0
- data/rust-vendor/linux-raw-sys/src/powerpc/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/powerpc/ioctl.rs +0 -1
- data/rust-vendor/linux-raw-sys/src/powerpc/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/powerpc/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/powerpc/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/powerpc/vm_sockets.rs +114 -0
- data/rust-vendor/linux-raw-sys/src/powerpc/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/powerpc64/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/powerpc64/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/powerpc64/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/powerpc64/if_tun.rs +325 -0
- data/rust-vendor/linux-raw-sys/src/powerpc64/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/powerpc64/ioctl.rs +0 -1
- data/rust-vendor/linux-raw-sys/src/powerpc64/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/powerpc64/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/powerpc64/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/powerpc64/vm_sockets.rs +117 -0
- data/rust-vendor/linux-raw-sys/src/powerpc64/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/riscv32/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/riscv32/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/riscv32/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/riscv32/if_tun.rs +317 -0
- data/rust-vendor/linux-raw-sys/src/riscv32/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/riscv32/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/riscv32/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/riscv32/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/riscv32/vm_sockets.rs +108 -0
- data/rust-vendor/linux-raw-sys/src/riscv32/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/riscv64/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/riscv64/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/riscv64/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/riscv64/if_tun.rs +319 -0
- data/rust-vendor/linux-raw-sys/src/riscv64/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/riscv64/ioctl.rs +0 -1
- data/rust-vendor/linux-raw-sys/src/riscv64/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/riscv64/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/riscv64/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/riscv64/vm_sockets.rs +111 -0
- data/rust-vendor/linux-raw-sys/src/riscv64/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/s390x/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/s390x/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/s390x/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/s390x/if_tun.rs +339 -0
- data/rust-vendor/linux-raw-sys/src/s390x/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/s390x/ioctl.rs +0 -1
- data/rust-vendor/linux-raw-sys/src/s390x/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/s390x/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/s390x/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/s390x/vm_sockets.rs +131 -0
- data/rust-vendor/linux-raw-sys/src/s390x/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/sparc/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/sparc/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/sparc/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/sparc/if_tun.rs +317 -0
- data/rust-vendor/linux-raw-sys/src/sparc/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/sparc/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/sparc/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/sparc/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/sparc/vm_sockets.rs +108 -0
- data/rust-vendor/linux-raw-sys/src/sparc/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/sparc64/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/sparc64/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/sparc64/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/sparc64/if_tun.rs +325 -0
- data/rust-vendor/linux-raw-sys/src/sparc64/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/sparc64/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/sparc64/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/sparc64/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/sparc64/vm_sockets.rs +117 -0
- data/rust-vendor/linux-raw-sys/src/sparc64/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/x32/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/x32/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/x32/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/x32/if_tun.rs +319 -0
- data/rust-vendor/linux-raw-sys/src/x32/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/x32/ioctl.rs +0 -1
- data/rust-vendor/linux-raw-sys/src/x32/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/x32/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/x32/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/x32/vm_sockets.rs +111 -0
- data/rust-vendor/linux-raw-sys/src/x32/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/x86/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/x86/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/x86/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/x86/if_tun.rs +317 -0
- data/rust-vendor/linux-raw-sys/src/x86/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/x86/ioctl.rs +0 -1
- data/rust-vendor/linux-raw-sys/src/x86/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/x86/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/x86/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/x86/vm_sockets.rs +108 -0
- data/rust-vendor/linux-raw-sys/src/x86/xdp.rs +1 -0
- data/rust-vendor/linux-raw-sys/src/x86_64/btrfs.rs +42 -1
- data/rust-vendor/linux-raw-sys/src/x86_64/general.rs +52 -2
- data/rust-vendor/linux-raw-sys/src/x86_64/if_arp.rs +6 -2
- data/rust-vendor/linux-raw-sys/src/x86_64/if_tun.rs +319 -0
- data/rust-vendor/linux-raw-sys/src/x86_64/io_uring.rs +52 -1
- data/rust-vendor/linux-raw-sys/src/x86_64/ioctl.rs +0 -1
- data/rust-vendor/linux-raw-sys/src/x86_64/net.rs +5 -1
- data/rust-vendor/linux-raw-sys/src/x86_64/netlink.rs +153 -6
- data/rust-vendor/linux-raw-sys/src/x86_64/prctl.rs +3 -2
- data/rust-vendor/linux-raw-sys/src/x86_64/vm_sockets.rs +111 -0
- data/rust-vendor/linux-raw-sys/src/x86_64/xdp.rs +1 -0
- data/rust-vendor/markup5ever/.cargo-checksum.json +1 -1
- data/rust-vendor/markup5ever/.cargo_vcs_info.json +1 -1
- data/rust-vendor/markup5ever/Cargo.toml +6 -3
- data/rust-vendor/markup5ever/Cargo.toml.orig +3 -0
- data/rust-vendor/markup5ever/interface/mod.rs +9 -0
- data/rust-vendor/markup5ever/interface/tree_builder.rs +11 -0
- data/rust-vendor/pin-project-lite/.cargo-checksum.json +1 -0
- data/rust-vendor/pin-project-lite/.cargo_vcs_info.json +6 -0
- data/rust-vendor/pin-project-lite/CHANGELOG.md +264 -0
- data/rust-vendor/pin-project-lite/Cargo.lock +23 -0
- data/rust-vendor/pin-project-lite/Cargo.toml +198 -0
- data/rust-vendor/pin-project-lite/Cargo.toml.orig +91 -0
- data/rust-vendor/pin-project-lite/LICENSE-APACHE +177 -0
- data/rust-vendor/pin-project-lite/LICENSE-MIT +23 -0
- data/rust-vendor/pin-project-lite/README.md +129 -0
- data/rust-vendor/pin-project-lite/src/lib.rs +1770 -0
- data/rust-vendor/pin-project-lite/tests/auxiliary/mod.rs +14 -0
- data/rust-vendor/pin-project-lite/tests/compiletest.rs +11 -0
- data/rust-vendor/pin-project-lite/tests/drop_order.rs +169 -0
- data/rust-vendor/pin-project-lite/tests/expand/.rustfmt.toml +1 -0
- data/rust-vendor/pin-project-lite/tests/expand/default/enum.expanded.rs +166 -0
- data/rust-vendor/pin-project-lite/tests/expand/default/enum.rs +19 -0
- data/rust-vendor/pin-project-lite/tests/expand/default/struct.expanded.rs +107 -0
- data/rust-vendor/pin-project-lite/tests/expand/default/struct.rs +13 -0
- data/rust-vendor/pin-project-lite/tests/expand/multifields/enum.expanded.rs +102 -0
- data/rust-vendor/pin-project-lite/tests/expand/multifields/enum.rs +20 -0
- data/rust-vendor/pin-project-lite/tests/expand/multifields/struct.expanded.rs +174 -0
- data/rust-vendor/pin-project-lite/tests/expand/multifields/struct.rs +17 -0
- data/rust-vendor/pin-project-lite/tests/expand/naming/enum-all.expanded.rs +166 -0
- data/rust-vendor/pin-project-lite/tests/expand/naming/enum-all.rs +19 -0
- data/rust-vendor/pin-project-lite/tests/expand/naming/enum-mut.expanded.rs +76 -0
- data/rust-vendor/pin-project-lite/tests/expand/naming/enum-mut.rs +17 -0
- data/rust-vendor/pin-project-lite/tests/expand/naming/enum-none.expanded.rs +33 -0
- data/rust-vendor/pin-project-lite/tests/expand/naming/enum-none.rs +16 -0
- data/rust-vendor/pin-project-lite/tests/expand/naming/enum-ref.expanded.rs +76 -0
- data/rust-vendor/pin-project-lite/tests/expand/naming/enum-ref.rs +17 -0
- data/rust-vendor/pin-project-lite/tests/expand/naming/struct-all.expanded.rs +151 -0
- data/rust-vendor/pin-project-lite/tests/expand/naming/struct-all.rs +16 -0
- data/rust-vendor/pin-project-lite/tests/expand/naming/struct-mut.expanded.rs +107 -0
- data/rust-vendor/pin-project-lite/tests/expand/naming/struct-mut.rs +14 -0
- data/rust-vendor/pin-project-lite/tests/expand/naming/struct-none.expanded.rs +107 -0
- data/rust-vendor/pin-project-lite/tests/expand/naming/struct-none.rs +13 -0
- data/rust-vendor/pin-project-lite/tests/expand/naming/struct-ref.expanded.rs +107 -0
- data/rust-vendor/pin-project-lite/tests/expand/naming/struct-ref.rs +14 -0
- data/rust-vendor/pin-project-lite/tests/expand/not_unpin/enum.expanded.rs +114 -0
- data/rust-vendor/pin-project-lite/tests/expand/not_unpin/enum.rs +19 -0
- data/rust-vendor/pin-project-lite/tests/expand/not_unpin/struct.expanded.rs +103 -0
- data/rust-vendor/pin-project-lite/tests/expand/not_unpin/struct.rs +16 -0
- data/rust-vendor/pin-project-lite/tests/expand/pinned_drop/enum.expanded.rs +128 -0
- data/rust-vendor/pin-project-lite/tests/expand/pinned_drop/enum.rs +23 -0
- data/rust-vendor/pin-project-lite/tests/expand/pinned_drop/struct.expanded.rs +117 -0
- data/rust-vendor/pin-project-lite/tests/expand/pinned_drop/struct.rs +18 -0
- data/rust-vendor/pin-project-lite/tests/expand/pub/enum.expanded.rs +118 -0
- data/rust-vendor/pin-project-lite/tests/expand/pub/enum.rs +18 -0
- data/rust-vendor/pin-project-lite/tests/expand/pub/struct.expanded.rs +107 -0
- data/rust-vendor/pin-project-lite/tests/expand/pub/struct.rs +13 -0
- data/rust-vendor/pin-project-lite/tests/expandtest.rs +10 -0
- data/rust-vendor/pin-project-lite/tests/include/basic.rs +81 -0
- data/rust-vendor/pin-project-lite/tests/proper_unpin.rs +101 -0
- data/rust-vendor/pin-project-lite/tests/test.rs +699 -0
- data/rust-vendor/pin-project-lite/tests/ui/not_unpin/conflict-unpin.rs +38 -0
- data/rust-vendor/pin-project-lite/tests/ui/not_unpin/conflict-unpin.stderr +50 -0
- data/rust-vendor/pin-project-lite/tests/ui/not_unpin/negative_impls_stable.rs +22 -0
- data/rust-vendor/pin-project-lite/tests/ui/not_unpin/negative_impls_stable.stderr +16 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/conflict-drop.rs +17 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/conflict-drop.stderr +15 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/conflict-unpin.rs +66 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/conflict-unpin.stderr +81 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/invalid-bounds.rs +95 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/invalid-bounds.stderr +512 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/invalid.rs +27 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/invalid.stderr +47 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/negative_impls_stable.rs +21 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/negative_impls_stable.stderr +15 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.rs +12 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/overlapping_lifetime_names.stderr +75 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.rs +22 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/overlapping_unpin_struct.stderr +34 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/packed.rs +21 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/packed.stderr +95 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/unpin_sneaky.rs +14 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/unpin_sneaky.stderr +5 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/unsupported.rs +29 -0
- data/rust-vendor/pin-project-lite/tests/ui/pin_project/unsupported.stderr +111 -0
- data/rust-vendor/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.rs +19 -0
- data/rust-vendor/pin-project-lite/tests/ui/pinned_drop/call-drop-inner.stderr +22 -0
- data/rust-vendor/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.rs +28 -0
- data/rust-vendor/pin-project-lite/tests/ui/pinned_drop/conditional-drop-impl.stderr +34 -0
- data/rust-vendor/regex-syntax/.cargo-checksum.json +1 -1
- data/rust-vendor/regex-syntax/.cargo_vcs_info.json +1 -1
- data/rust-vendor/regex-syntax/Cargo.lock +1 -1
- data/rust-vendor/regex-syntax/Cargo.toml +6 -1
- data/rust-vendor/regex-syntax/Cargo.toml.orig +1 -1
- data/rust-vendor/regex-syntax/benches/bench.rs +63 -0
- data/rust-vendor/regex-syntax/src/hir/translate.rs +6 -2
- data/rust-vendor/rgb/.cargo-checksum.json +1 -1
- data/rust-vendor/rgb/.cargo_vcs_info.json +1 -1
- data/rust-vendor/rgb/Cargo.lock +31 -20
- data/rust-vendor/rgb/Cargo.toml +1 -1
- data/rust-vendor/rgb/Cargo.toml.orig +1 -1
- data/rust-vendor/rgb/examples/example.rs +1 -12
- data/rust-vendor/rgb/src/as_bytes.rs +0 -21
- data/rust-vendor/rgb/src/formats/gray.rs +3 -2
- data/rust-vendor/rgb/src/legacy/alt.rs +7 -51
- data/rust-vendor/rgb/src/legacy/internal/convert/array.rs +0 -16
- data/rust-vendor/rgb/src/legacy/internal/convert/mod.rs +24 -74
- data/rust-vendor/rgb/src/legacy/internal/convert/tuple.rs +0 -9
- data/rust-vendor/rgb/src/legacy/internal/ops.rs +0 -156
- data/rust-vendor/rgb/src/legacy/internal/pixel.rs +8 -2
- data/rust-vendor/rgb/src/legacy/internal/rgb.rs +8 -61
- data/rust-vendor/rgb/src/legacy/internal/rgba.rs +8 -92
- data/rust-vendor/rgb/src/lib.rs +6 -113
- data/rust-vendor/rustix/.cargo-checksum.json +1 -1
- data/rust-vendor/rustix/.cargo_vcs_info.json +1 -1
- data/rust-vendor/rustix/Cargo.lock +301 -91
- data/rust-vendor/rustix/Cargo.toml +5 -5
- data/rust-vendor/rustix/Cargo.toml.orig +5 -5
- data/rust-vendor/rustix/README.md +4 -5
- data/rust-vendor/rustix/src/backend/libc/fs/makedev.rs +2 -22
- data/rust-vendor/rustix/src/backend/libc/fs/syscalls.rs +20 -2
- data/rust-vendor/rustix/src/backend/libc/fs/types.rs +16 -0
- data/rust-vendor/rustix/src/backend/linux_raw/arch/riscv64.rs +432 -13
- data/rust-vendor/rustix/src/fs/at.rs +30 -14
- data/rust-vendor/rustix/src/fs/mod.rs +2 -4
- data/rust-vendor/rustix/src/process/types.rs +23 -8
- data/rust-vendor/slab/.cargo-checksum.json +1 -0
- data/rust-vendor/slab/.cargo_vcs_info.json +6 -0
- data/rust-vendor/slab/CHANGELOG.md +71 -0
- data/rust-vendor/slab/Cargo.lock +83 -0
- data/rust-vendor/slab/Cargo.toml +67 -0
- data/rust-vendor/slab/Cargo.toml.orig +29 -0
- data/rust-vendor/slab/LICENSE +25 -0
- data/rust-vendor/slab/README.md +51 -0
- data/rust-vendor/slab/SECURITY.md +9 -0
- data/rust-vendor/slab/src/builder.rs +63 -0
- data/rust-vendor/slab/src/lib.rs +1653 -0
- data/rust-vendor/slab/src/serde.rs +62 -0
- data/rust-vendor/slab/tests/serde.rs +49 -0
- data/rust-vendor/slab/tests/slab.rs +782 -0
- data/rust-vendor/syn/.cargo-checksum.json +1 -1
- data/rust-vendor/syn/.cargo_vcs_info.json +1 -1
- data/rust-vendor/syn/Cargo.lock +30 -30
- data/rust-vendor/syn/Cargo.toml +1 -1
- data/rust-vendor/syn/Cargo.toml.orig +1 -1
- data/rust-vendor/syn/src/item.rs +3 -0
- data/rust-vendor/syn/src/lib.rs +1 -1
- data/rust-vendor/syn/tests/common/eq.rs +1 -1
- data/rust-vendor/tempfile/.cargo-checksum.json +1 -1
- data/rust-vendor/tempfile/.cargo_vcs_info.json +1 -1
- data/rust-vendor/tempfile/CHANGELOG.md +4 -0
- data/rust-vendor/tempfile/Cargo.lock +7 -7
- data/rust-vendor/tempfile/Cargo.toml +2 -2
- data/rust-vendor/tempfile/Cargo.toml.orig +2 -2
- data/rust-vendor/tempfile/README.md +23 -6
- data/rust-vendor/tempfile/src/env.rs +1 -1
- data/rust-vendor/tempfile/src/file/imp/unix.rs +2 -10
- data/rust-vendor/tempfile/src/lib.rs +1 -1
- data/rust-vendor/tempfile/src/util.rs +1 -1
- data/rust-vendor/tendril/.cargo-checksum.json +1 -1
- data/rust-vendor/tendril/.cargo_vcs_info.json +2 -2
- data/rust-vendor/tendril/Cargo.lock +642 -68
- data/rust-vendor/tendril/Cargo.toml +44 -16
- data/rust-vendor/tendril/Cargo.toml.orig +26 -15
- data/rust-vendor/tendril/README.md +27 -27
- data/rust-vendor/tendril/benches/futf.rs +63 -0
- data/rust-vendor/tendril/benches/tendril.rs +158 -0
- data/rust-vendor/tendril/examples/fuzz.rs +22 -25
- data/rust-vendor/tendril/src/buf32.rs +4 -9
- data/rust-vendor/tendril/src/fmt.rs +23 -26
- data/rust-vendor/tendril/src/futf.rs +504 -0
- data/rust-vendor/tendril/src/lib.rs +13 -13
- data/rust-vendor/tendril/src/stream.rs +46 -140
- data/rust-vendor/tendril/src/tendril.rs +56 -175
- data/rust-vendor/tendril/src/utf8_decode.rs +12 -14
- data/rust-vendor/tendril/src/util.rs +5 -9
- data/rust-vendor/tokio/.cargo-checksum.json +1 -0
- data/rust-vendor/tokio/.cargo_vcs_info.json +6 -0
- data/rust-vendor/tokio/CHANGELOG.md +4253 -0
- data/rust-vendor/tokio/Cargo.toml +934 -0
- data/rust-vendor/tokio/Cargo.toml.orig +189 -0
- data/rust-vendor/tokio/LICENSE +21 -0
- data/rust-vendor/tokio/README.md +255 -0
- data/rust-vendor/tokio/docs/reactor-refactor.md +276 -0
- data/rust-vendor/tokio/src/blocking.rs +63 -0
- data/rust-vendor/tokio/src/doc/mod.rs +47 -0
- data/rust-vendor/tokio/src/doc/os.rs +68 -0
- data/rust-vendor/tokio/src/fs/canonicalize.rs +49 -0
- data/rust-vendor/tokio/src/fs/copy.rs +24 -0
- data/rust-vendor/tokio/src/fs/create_dir.rs +50 -0
- data/rust-vendor/tokio/src/fs/create_dir_all.rs +51 -0
- data/rust-vendor/tokio/src/fs/dir_builder.rs +129 -0
- data/rust-vendor/tokio/src/fs/file/tests.rs +978 -0
- data/rust-vendor/tokio/src/fs/file.rs +995 -0
- data/rust-vendor/tokio/src/fs/hard_link.rs +44 -0
- data/rust-vendor/tokio/src/fs/metadata.rs +46 -0
- data/rust-vendor/tokio/src/fs/mocks.rs +176 -0
- data/rust-vendor/tokio/src/fs/mod.rs +324 -0
- data/rust-vendor/tokio/src/fs/open_options/mock_open_options.rs +39 -0
- data/rust-vendor/tokio/src/fs/open_options/uring_open_options.rs +128 -0
- data/rust-vendor/tokio/src/fs/open_options.rs +853 -0
- data/rust-vendor/tokio/src/fs/read.rs +77 -0
- data/rust-vendor/tokio/src/fs/read_dir.rs +357 -0
- data/rust-vendor/tokio/src/fs/read_link.rs +12 -0
- data/rust-vendor/tokio/src/fs/read_to_string.rs +30 -0
- data/rust-vendor/tokio/src/fs/read_uring.rs +134 -0
- data/rust-vendor/tokio/src/fs/remove_dir.rs +12 -0
- data/rust-vendor/tokio/src/fs/remove_dir_all.rs +14 -0
- data/rust-vendor/tokio/src/fs/remove_file.rs +16 -0
- data/rust-vendor/tokio/src/fs/rename.rs +17 -0
- data/rust-vendor/tokio/src/fs/set_permissions.rs +15 -0
- data/rust-vendor/tokio/src/fs/symlink.rs +16 -0
- data/rust-vendor/tokio/src/fs/symlink_dir.rs +19 -0
- data/rust-vendor/tokio/src/fs/symlink_file.rs +19 -0
- data/rust-vendor/tokio/src/fs/symlink_metadata.rs +15 -0
- data/rust-vendor/tokio/src/fs/try_exists.rs +28 -0
- data/rust-vendor/tokio/src/fs/write.rs +96 -0
- data/rust-vendor/tokio/src/future/block_on.rs +22 -0
- data/rust-vendor/tokio/src/future/maybe_done.rs +123 -0
- data/rust-vendor/tokio/src/future/mod.rs +28 -0
- data/rust-vendor/tokio/src/future/trace.rs +11 -0
- data/rust-vendor/tokio/src/future/try_join.rs +82 -0
- data/rust-vendor/tokio/src/fuzz.rs +1 -0
- data/rust-vendor/tokio/src/io/async_buf_read.rs +117 -0
- data/rust-vendor/tokio/src/io/async_fd.rs +1439 -0
- data/rust-vendor/tokio/src/io/async_read.rs +133 -0
- data/rust-vendor/tokio/src/io/async_seek.rs +96 -0
- data/rust-vendor/tokio/src/io/async_write.rs +403 -0
- data/rust-vendor/tokio/src/io/blocking.rs +306 -0
- data/rust-vendor/tokio/src/io/bsd/poll_aio.rs +197 -0
- data/rust-vendor/tokio/src/io/interest.rs +345 -0
- data/rust-vendor/tokio/src/io/join.rs +130 -0
- data/rust-vendor/tokio/src/io/mod.rs +308 -0
- data/rust-vendor/tokio/src/io/poll_evented.rs +297 -0
- data/rust-vendor/tokio/src/io/read_buf.rs +344 -0
- data/rust-vendor/tokio/src/io/ready.rs +322 -0
- data/rust-vendor/tokio/src/io/seek.rs +57 -0
- data/rust-vendor/tokio/src/io/split.rs +166 -0
- data/rust-vendor/tokio/src/io/stderr.rs +134 -0
- data/rust-vendor/tokio/src/io/stdin.rs +98 -0
- data/rust-vendor/tokio/src/io/stdio_common.rs +222 -0
- data/rust-vendor/tokio/src/io/stdout.rs +183 -0
- data/rust-vendor/tokio/src/io/uring/mod.rs +4 -0
- data/rust-vendor/tokio/src/io/uring/open.rs +59 -0
- data/rust-vendor/tokio/src/io/uring/read.rs +61 -0
- data/rust-vendor/tokio/src/io/uring/utils.rs +6 -0
- data/rust-vendor/tokio/src/io/uring/write.rs +55 -0
- data/rust-vendor/tokio/src/io/util/async_buf_read_ext.rs +357 -0
- data/rust-vendor/tokio/src/io/util/async_read_ext.rs +1454 -0
- data/rust-vendor/tokio/src/io/util/async_seek_ext.rs +96 -0
- data/rust-vendor/tokio/src/io/util/async_write_ext.rs +1332 -0
- data/rust-vendor/tokio/src/io/util/buf_reader.rs +311 -0
- data/rust-vendor/tokio/src/io/util/buf_stream.rs +207 -0
- data/rust-vendor/tokio/src/io/util/buf_writer.rs +310 -0
- data/rust-vendor/tokio/src/io/util/chain.rs +144 -0
- data/rust-vendor/tokio/src/io/util/copy.rs +303 -0
- data/rust-vendor/tokio/src/io/util/copy_bidirectional.rs +137 -0
- data/rust-vendor/tokio/src/io/util/copy_buf.rs +117 -0
- data/rust-vendor/tokio/src/io/util/empty.rs +164 -0
- data/rust-vendor/tokio/src/io/util/fill_buf.rs +59 -0
- data/rust-vendor/tokio/src/io/util/flush.rs +47 -0
- data/rust-vendor/tokio/src/io/util/lines.rs +145 -0
- data/rust-vendor/tokio/src/io/util/mem.rs +429 -0
- data/rust-vendor/tokio/src/io/util/mod.rs +112 -0
- data/rust-vendor/tokio/src/io/util/read.rs +55 -0
- data/rust-vendor/tokio/src/io/util/read_buf.rs +71 -0
- data/rust-vendor/tokio/src/io/util/read_exact.rs +69 -0
- data/rust-vendor/tokio/src/io/util/read_int.rs +158 -0
- data/rust-vendor/tokio/src/io/util/read_line.rs +119 -0
- data/rust-vendor/tokio/src/io/util/read_to_end.rs +143 -0
- data/rust-vendor/tokio/src/io/util/read_to_string.rs +78 -0
- data/rust-vendor/tokio/src/io/util/read_until.rs +80 -0
- data/rust-vendor/tokio/src/io/util/repeat.rs +74 -0
- data/rust-vendor/tokio/src/io/util/shutdown.rs +46 -0
- data/rust-vendor/tokio/src/io/util/sink.rs +94 -0
- data/rust-vendor/tokio/src/io/util/split.rs +121 -0
- data/rust-vendor/tokio/src/io/util/take.rs +138 -0
- data/rust-vendor/tokio/src/io/util/vec_with_initialized.rs +142 -0
- data/rust-vendor/tokio/src/io/util/write.rs +46 -0
- data/rust-vendor/tokio/src/io/util/write_all.rs +55 -0
- data/rust-vendor/tokio/src/io/util/write_all_buf.rs +64 -0
- data/rust-vendor/tokio/src/io/util/write_buf.rs +55 -0
- data/rust-vendor/tokio/src/io/util/write_int.rs +151 -0
- data/rust-vendor/tokio/src/io/util/write_vectored.rs +47 -0
- data/rust-vendor/tokio/src/lib.rs +707 -0
- data/rust-vendor/tokio/src/loom/mocked.rs +85 -0
- data/rust-vendor/tokio/src/loom/mod.rs +14 -0
- data/rust-vendor/tokio/src/loom/std/atomic_u16.rs +47 -0
- data/rust-vendor/tokio/src/loom/std/atomic_u32.rs +47 -0
- data/rust-vendor/tokio/src/loom/std/atomic_u64.rs +19 -0
- data/rust-vendor/tokio/src/loom/std/atomic_u64_as_mutex.rs +76 -0
- data/rust-vendor/tokio/src/loom/std/atomic_u64_native.rs +4 -0
- data/rust-vendor/tokio/src/loom/std/atomic_u64_static_const_new.rs +12 -0
- data/rust-vendor/tokio/src/loom/std/atomic_u64_static_once_cell.rs +57 -0
- data/rust-vendor/tokio/src/loom/std/atomic_usize.rs +59 -0
- data/rust-vendor/tokio/src/loom/std/barrier.rs +223 -0
- data/rust-vendor/tokio/src/loom/std/mod.rs +124 -0
- data/rust-vendor/tokio/src/loom/std/mutex.rs +36 -0
- data/rust-vendor/tokio/src/loom/std/parking_lot.rs +195 -0
- data/rust-vendor/tokio/src/loom/std/rwlock.rs +48 -0
- data/rust-vendor/tokio/src/loom/std/unsafe_cell.rs +18 -0
- data/rust-vendor/tokio/src/macros/addr_of.rs +27 -0
- data/rust-vendor/tokio/src/macros/cfg.rs +713 -0
- data/rust-vendor/tokio/src/macros/join.rs +279 -0
- data/rust-vendor/tokio/src/macros/loom.rs +8 -0
- data/rust-vendor/tokio/src/macros/mod.rs +36 -0
- data/rust-vendor/tokio/src/macros/pin.rs +144 -0
- data/rust-vendor/tokio/src/macros/select.rs +1411 -0
- data/rust-vendor/tokio/src/macros/support.rs +32 -0
- data/rust-vendor/tokio/src/macros/thread_local.rs +18 -0
- data/rust-vendor/tokio/src/macros/trace.rs +26 -0
- data/rust-vendor/tokio/src/macros/try_join.rs +280 -0
- data/rust-vendor/tokio/src/net/addr.rs +333 -0
- data/rust-vendor/tokio/src/net/lookup_host.rs +38 -0
- data/rust-vendor/tokio/src/net/mod.rs +64 -0
- data/rust-vendor/tokio/src/net/tcp/listener.rs +460 -0
- data/rust-vendor/tokio/src/net/tcp/mod.rs +16 -0
- data/rust-vendor/tokio/src/net/tcp/socket.rs +1027 -0
- data/rust-vendor/tokio/src/net/tcp/split.rs +423 -0
- data/rust-vendor/tokio/src/net/tcp/split_owned.rs +507 -0
- data/rust-vendor/tokio/src/net/tcp/stream.rs +1541 -0
- data/rust-vendor/tokio/src/net/udp.rs +2333 -0
- data/rust-vendor/tokio/src/net/unix/datagram/mod.rs +3 -0
- data/rust-vendor/tokio/src/net/unix/datagram/socket.rs +1621 -0
- data/rust-vendor/tokio/src/net/unix/listener.rs +247 -0
- data/rust-vendor/tokio/src/net/unix/mod.rs +39 -0
- data/rust-vendor/tokio/src/net/unix/pipe.rs +1442 -0
- data/rust-vendor/tokio/src/net/unix/socket.rs +273 -0
- data/rust-vendor/tokio/src/net/unix/socketaddr.rs +66 -0
- data/rust-vendor/tokio/src/net/unix/split.rs +331 -0
- data/rust-vendor/tokio/src/net/unix/split_owned.rs +419 -0
- data/rust-vendor/tokio/src/net/unix/stream.rs +1095 -0
- data/rust-vendor/tokio/src/net/unix/ucred.rs +332 -0
- data/rust-vendor/tokio/src/net/windows/mod.rs +3 -0
- data/rust-vendor/tokio/src/net/windows/named_pipe.rs +2699 -0
- data/rust-vendor/tokio/src/process/kill.rs +13 -0
- data/rust-vendor/tokio/src/process/mod.rs +1854 -0
- data/rust-vendor/tokio/src/process/unix/mod.rs +374 -0
- data/rust-vendor/tokio/src/process/unix/orphan.rs +334 -0
- data/rust-vendor/tokio/src/process/unix/pidfd_reaper.rs +352 -0
- data/rust-vendor/tokio/src/process/unix/reap.rs +298 -0
- data/rust-vendor/tokio/src/process/windows.rs +285 -0
- data/rust-vendor/tokio/src/runtime/blocking/mod.rs +26 -0
- data/rust-vendor/tokio/src/runtime/blocking/pool.rs +606 -0
- data/rust-vendor/tokio/src/runtime/blocking/schedule.rs +66 -0
- data/rust-vendor/tokio/src/runtime/blocking/shutdown.rs +71 -0
- data/rust-vendor/tokio/src/runtime/blocking/task.rs +44 -0
- data/rust-vendor/tokio/src/runtime/builder.rs +1840 -0
- data/rust-vendor/tokio/src/runtime/config.rs +54 -0
- data/rust-vendor/tokio/src/runtime/context/blocking.rs +121 -0
- data/rust-vendor/tokio/src/runtime/context/current.rs +97 -0
- data/rust-vendor/tokio/src/runtime/context/runtime.rs +99 -0
- data/rust-vendor/tokio/src/runtime/context/runtime_mt.rs +36 -0
- data/rust-vendor/tokio/src/runtime/context/scoped.rs +56 -0
- data/rust-vendor/tokio/src/runtime/context.rs +200 -0
- data/rust-vendor/tokio/src/runtime/driver/op.rs +207 -0
- data/rust-vendor/tokio/src/runtime/driver.rs +376 -0
- data/rust-vendor/tokio/src/runtime/dump.rs +340 -0
- data/rust-vendor/tokio/src/runtime/handle.rs +710 -0
- data/rust-vendor/tokio/src/runtime/id.rs +42 -0
- data/rust-vendor/tokio/src/runtime/io/driver/signal.rs +22 -0
- data/rust-vendor/tokio/src/runtime/io/driver/uring.rs +294 -0
- data/rust-vendor/tokio/src/runtime/io/driver.rs +333 -0
- data/rust-vendor/tokio/src/runtime/io/metrics.rs +24 -0
- data/rust-vendor/tokio/src/runtime/io/mod.rs +22 -0
- data/rust-vendor/tokio/src/runtime/io/registration.rs +259 -0
- data/rust-vendor/tokio/src/runtime/io/registration_set.rs +149 -0
- data/rust-vendor/tokio/src/runtime/io/scheduled_io.rs +582 -0
- data/rust-vendor/tokio/src/runtime/local_runtime/mod.rs +7 -0
- data/rust-vendor/tokio/src/runtime/local_runtime/options.rs +18 -0
- data/rust-vendor/tokio/src/runtime/local_runtime/runtime.rs +397 -0
- data/rust-vendor/tokio/src/runtime/metrics/batch.rs +303 -0
- data/rust-vendor/tokio/src/runtime/metrics/histogram/h2_histogram.rs +526 -0
- data/rust-vendor/tokio/src/runtime/metrics/histogram.rs +629 -0
- data/rust-vendor/tokio/src/runtime/metrics/io.rs +25 -0
- data/rust-vendor/tokio/src/runtime/metrics/mock.rs +15 -0
- data/rust-vendor/tokio/src/runtime/metrics/mod.rs +40 -0
- data/rust-vendor/tokio/src/runtime/metrics/runtime.rs +1122 -0
- data/rust-vendor/tokio/src/runtime/metrics/scheduler.rs +35 -0
- data/rust-vendor/tokio/src/runtime/metrics/worker.rs +110 -0
- data/rust-vendor/tokio/src/runtime/mod.rs +604 -0
- data/rust-vendor/tokio/src/runtime/park.rs +362 -0
- data/rust-vendor/tokio/src/runtime/process.rs +44 -0
- data/rust-vendor/tokio/src/runtime/runtime.rs +515 -0
- data/rust-vendor/tokio/src/runtime/scheduler/block_in_place.rs +9 -0
- data/rust-vendor/tokio/src/runtime/scheduler/current_thread/mod.rs +861 -0
- data/rust-vendor/tokio/src/runtime/scheduler/defer.rs +43 -0
- data/rust-vendor/tokio/src/runtime/scheduler/inject/metrics.rs +7 -0
- data/rust-vendor/tokio/src/runtime/scheduler/inject/pop.rs +55 -0
- data/rust-vendor/tokio/src/runtime/scheduler/inject/rt_multi_thread.rs +122 -0
- data/rust-vendor/tokio/src/runtime/scheduler/inject/shared.rs +121 -0
- data/rust-vendor/tokio/src/runtime/scheduler/inject/synced.rs +37 -0
- data/rust-vendor/tokio/src/runtime/scheduler/inject.rs +70 -0
- data/rust-vendor/tokio/src/runtime/scheduler/lock.rs +6 -0
- data/rust-vendor/tokio/src/runtime/scheduler/mod.rs +338 -0
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/counters.rs +62 -0
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/handle/metrics.rs +55 -0
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/handle/taskdump.rs +26 -0
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/handle.rs +132 -0
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/idle.rs +240 -0
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/mod.rs +105 -0
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/overflow.rs +26 -0
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/park.rs +300 -0
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/queue.rs +599 -0
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/stats.rs +137 -0
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/trace.rs +61 -0
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/trace_mock.rs +11 -0
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/worker/metrics.rs +15 -0
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/worker/taskdump.rs +79 -0
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/worker/taskdump_mock.rs +7 -0
- data/rust-vendor/tokio/src/runtime/scheduler/multi_thread/worker.rs +1497 -0
- data/rust-vendor/tokio/src/runtime/scheduler/util/mod.rs +2 -0
- data/rust-vendor/tokio/src/runtime/scheduler/util/time_alt.rs +179 -0
- data/rust-vendor/tokio/src/runtime/signal/mod.rs +143 -0
- data/rust-vendor/tokio/src/runtime/task/abort.rs +105 -0
- data/rust-vendor/tokio/src/runtime/task/core.rs +570 -0
- data/rust-vendor/tokio/src/runtime/task/error.rs +198 -0
- data/rust-vendor/tokio/src/runtime/task/harness.rs +567 -0
- data/rust-vendor/tokio/src/runtime/task/id.rs +92 -0
- data/rust-vendor/tokio/src/runtime/task/join.rs +373 -0
- data/rust-vendor/tokio/src/runtime/task/list.rs +368 -0
- data/rust-vendor/tokio/src/runtime/task/mod.rs +670 -0
- data/rust-vendor/tokio/src/runtime/task/raw.rs +378 -0
- data/rust-vendor/tokio/src/runtime/task/state.rs +662 -0
- data/rust-vendor/tokio/src/runtime/task/trace/mod.rs +364 -0
- data/rust-vendor/tokio/src/runtime/task/trace/symbol.rs +92 -0
- data/rust-vendor/tokio/src/runtime/task/trace/tree.rs +126 -0
- data/rust-vendor/tokio/src/runtime/task/waker.rs +124 -0
- data/rust-vendor/tokio/src/runtime/task_hooks.rs +83 -0
- data/rust-vendor/tokio/src/runtime/tests/inject.rs +54 -0
- data/rust-vendor/tokio/src/runtime/tests/loom_blocking.rs +102 -0
- data/rust-vendor/tokio/src/runtime/tests/loom_current_thread/yield_now.rs +30 -0
- data/rust-vendor/tokio/src/runtime/tests/loom_current_thread.rs +198 -0
- data/rust-vendor/tokio/src/runtime/tests/loom_join_set.rs +82 -0
- data/rust-vendor/tokio/src/runtime/tests/loom_local.rs +47 -0
- data/rust-vendor/tokio/src/runtime/tests/loom_multi_thread/queue.rs +205 -0
- data/rust-vendor/tokio/src/runtime/tests/loom_multi_thread/shutdown.rs +28 -0
- data/rust-vendor/tokio/src/runtime/tests/loom_multi_thread/yield_now.rs +37 -0
- data/rust-vendor/tokio/src/runtime/tests/loom_multi_thread.rs +461 -0
- data/rust-vendor/tokio/src/runtime/tests/loom_oneshot.rs +48 -0
- data/rust-vendor/tokio/src/runtime/tests/mod.rs +85 -0
- data/rust-vendor/tokio/src/runtime/tests/queue.rs +273 -0
- data/rust-vendor/tokio/src/runtime/tests/task.rs +469 -0
- data/rust-vendor/tokio/src/runtime/tests/task_combinations.rs +488 -0
- data/rust-vendor/tokio/src/runtime/thread_id.rs +31 -0
- data/rust-vendor/tokio/src/runtime/time/entry.rs +693 -0
- data/rust-vendor/tokio/src/runtime/time/handle.rs +68 -0
- data/rust-vendor/tokio/src/runtime/time/mod.rs +493 -0
- data/rust-vendor/tokio/src/runtime/time/source.rs +45 -0
- data/rust-vendor/tokio/src/runtime/time/tests/mod.rs +269 -0
- data/rust-vendor/tokio/src/runtime/time/wheel/level.rs +192 -0
- data/rust-vendor/tokio/src/runtime/time/wheel/mod.rs +331 -0
- data/rust-vendor/tokio/src/runtime/time_alt/cancellation_queue/tests.rs +97 -0
- data/rust-vendor/tokio/src/runtime/time_alt/cancellation_queue.rs +92 -0
- data/rust-vendor/tokio/src/runtime/time_alt/context.rs +47 -0
- data/rust-vendor/tokio/src/runtime/time_alt/entry.rs +276 -0
- data/rust-vendor/tokio/src/runtime/time_alt/mod.rs +24 -0
- data/rust-vendor/tokio/src/runtime/time_alt/registration_queue/tests.rs +53 -0
- data/rust-vendor/tokio/src/runtime/time_alt/registration_queue.rs +43 -0
- data/rust-vendor/tokio/src/runtime/time_alt/tests.rs +168 -0
- data/rust-vendor/tokio/src/runtime/time_alt/timer.rs +169 -0
- data/rust-vendor/tokio/src/runtime/time_alt/wake_queue/tests.rs +66 -0
- data/rust-vendor/tokio/src/runtime/time_alt/wake_queue.rs +50 -0
- data/rust-vendor/tokio/src/runtime/time_alt/wheel/level.rs +194 -0
- data/rust-vendor/tokio/src/runtime/time_alt/wheel/mod.rs +272 -0
- data/rust-vendor/tokio/src/signal/ctrl_c.rs +62 -0
- data/rust-vendor/tokio/src/signal/mod.rs +100 -0
- data/rust-vendor/tokio/src/signal/registry.rs +275 -0
- data/rust-vendor/tokio/src/signal/reusable_box.rs +230 -0
- data/rust-vendor/tokio/src/signal/unix.rs +570 -0
- data/rust-vendor/tokio/src/signal/windows/stub.rs +25 -0
- data/rust-vendor/tokio/src/signal/windows/sys.rs +244 -0
- data/rust-vendor/tokio/src/signal/windows.rs +526 -0
- data/rust-vendor/tokio/src/sync/barrier.rs +213 -0
- data/rust-vendor/tokio/src/sync/batch_semaphore.rs +780 -0
- data/rust-vendor/tokio/src/sync/broadcast.rs +1759 -0
- data/rust-vendor/tokio/src/sync/mod.rs +524 -0
- data/rust-vendor/tokio/src/sync/mpsc/block.rs +477 -0
- data/rust-vendor/tokio/src/sync/mpsc/bounded.rs +1949 -0
- data/rust-vendor/tokio/src/sync/mpsc/chan.rs +628 -0
- data/rust-vendor/tokio/src/sync/mpsc/error.rs +168 -0
- data/rust-vendor/tokio/src/sync/mpsc/list.rs +419 -0
- data/rust-vendor/tokio/src/sync/mpsc/mod.rs +144 -0
- data/rust-vendor/tokio/src/sync/mpsc/unbounded.rs +726 -0
- data/rust-vendor/tokio/src/sync/mutex.rs +1396 -0
- data/rust-vendor/tokio/src/sync/notify.rs +1409 -0
- data/rust-vendor/tokio/src/sync/once_cell.rs +512 -0
- data/rust-vendor/tokio/src/sync/oneshot.rs +1594 -0
- data/rust-vendor/tokio/src/sync/rwlock/owned_read_guard.rs +208 -0
- data/rust-vendor/tokio/src/sync/rwlock/owned_write_guard.rs +460 -0
- data/rust-vendor/tokio/src/sync/rwlock/owned_write_guard_mapped.rs +230 -0
- data/rust-vendor/tokio/src/sync/rwlock/read_guard.rs +191 -0
- data/rust-vendor/tokio/src/sync/rwlock/write_guard.rs +457 -0
- data/rust-vendor/tokio/src/sync/rwlock/write_guard_mapped.rs +213 -0
- data/rust-vendor/tokio/src/sync/rwlock.rs +1121 -0
- data/rust-vendor/tokio/src/sync/semaphore.rs +1206 -0
- data/rust-vendor/tokio/src/sync/set_once.rs +388 -0
- data/rust-vendor/tokio/src/sync/task/atomic_waker.rs +383 -0
- data/rust-vendor/tokio/src/sync/task/mod.rs +4 -0
- data/rust-vendor/tokio/src/sync/tests/atomic_waker.rs +113 -0
- data/rust-vendor/tokio/src/sync/tests/loom_atomic_waker.rs +100 -0
- data/rust-vendor/tokio/src/sync/tests/loom_broadcast.rs +207 -0
- data/rust-vendor/tokio/src/sync/tests/loom_list.rs +48 -0
- data/rust-vendor/tokio/src/sync/tests/loom_mpsc.rs +224 -0
- data/rust-vendor/tokio/src/sync/tests/loom_notify.rs +330 -0
- data/rust-vendor/tokio/src/sync/tests/loom_oneshot.rs +187 -0
- data/rust-vendor/tokio/src/sync/tests/loom_rwlock.rs +105 -0
- data/rust-vendor/tokio/src/sync/tests/loom_semaphore_batch.rs +242 -0
- data/rust-vendor/tokio/src/sync/tests/loom_set_once.rs +72 -0
- data/rust-vendor/tokio/src/sync/tests/loom_watch.rs +110 -0
- data/rust-vendor/tokio/src/sync/tests/mod.rs +18 -0
- data/rust-vendor/tokio/src/sync/tests/notify.rs +121 -0
- data/rust-vendor/tokio/src/sync/tests/semaphore_batch.rs +310 -0
- data/rust-vendor/tokio/src/sync/watch.rs +1556 -0
- data/rust-vendor/tokio/src/task/blocking.rs +212 -0
- data/rust-vendor/tokio/src/task/builder.rs +235 -0
- data/rust-vendor/tokio/src/task/coop/consume_budget.rs +39 -0
- data/rust-vendor/tokio/src/task/coop/mod.rs +573 -0
- data/rust-vendor/tokio/src/task/coop/unconstrained.rs +45 -0
- data/rust-vendor/tokio/src/task/join_set.rs +851 -0
- data/rust-vendor/tokio/src/task/local.rs +1353 -0
- data/rust-vendor/tokio/src/task/mod.rs +335 -0
- data/rust-vendor/tokio/src/task/spawn.rs +210 -0
- data/rust-vendor/tokio/src/task/task_local.rs +488 -0
- data/rust-vendor/tokio/src/task/yield_now.rs +64 -0
- data/rust-vendor/tokio/src/time/clock.rs +320 -0
- data/rust-vendor/tokio/src/time/error.rs +123 -0
- data/rust-vendor/tokio/src/time/instant.rs +223 -0
- data/rust-vendor/tokio/src/time/interval.rs +643 -0
- data/rust-vendor/tokio/src/time/mod.rs +110 -0
- data/rust-vendor/tokio/src/time/sleep.rs +469 -0
- data/rust-vendor/tokio/src/time/timeout.rs +234 -0
- data/rust-vendor/tokio/src/util/as_ref.rs +38 -0
- data/rust-vendor/tokio/src/util/atomic_cell.rs +51 -0
- data/rust-vendor/tokio/src/util/bit.rs +64 -0
- data/rust-vendor/tokio/src/util/blocking_check.rs +29 -0
- data/rust-vendor/tokio/src/util/cacheline.rs +89 -0
- data/rust-vendor/tokio/src/util/error.rs +16 -0
- data/rust-vendor/tokio/src/util/idle_notified_set.rs +512 -0
- data/rust-vendor/tokio/src/util/linked_list.rs +808 -0
- data/rust-vendor/tokio/src/util/markers.rs +9 -0
- data/rust-vendor/tokio/src/util/memchr.rs +74 -0
- data/rust-vendor/tokio/src/util/metric_atomics.rs +81 -0
- data/rust-vendor/tokio/src/util/mod.rs +110 -0
- data/rust-vendor/tokio/src/util/ptr_expose.rs +74 -0
- data/rust-vendor/tokio/src/util/rand/rt.rs +61 -0
- data/rust-vendor/tokio/src/util/rand/rt_unstable.rs +20 -0
- data/rust-vendor/tokio/src/util/rand.rs +95 -0
- data/rust-vendor/tokio/src/util/rc_cell.rs +57 -0
- data/rust-vendor/tokio/src/util/sharded_list.rs +162 -0
- data/rust-vendor/tokio/src/util/sync_wrapper.rs +37 -0
- data/rust-vendor/tokio/src/util/trace.rs +191 -0
- data/rust-vendor/tokio/src/util/try_lock.rs +80 -0
- data/rust-vendor/tokio/src/util/typeid.rs +45 -0
- data/rust-vendor/tokio/src/util/wake.rs +78 -0
- data/rust-vendor/tokio/src/util/wake_list.rs +83 -0
- data/rust-vendor/tokio/tests/_require_full.rs +8 -0
- data/rust-vendor/tokio/tests/async_send_sync.rs +778 -0
- data/rust-vendor/tokio/tests/buffered.rs +51 -0
- data/rust-vendor/tokio/tests/coop_budget.rs +93 -0
- data/rust-vendor/tokio/tests/dump.rs +199 -0
- data/rust-vendor/tokio/tests/duplex_stream.rs +47 -0
- data/rust-vendor/tokio/tests/fs.rs +36 -0
- data/rust-vendor/tokio/tests/fs_canonicalize_dir.rs +22 -0
- data/rust-vendor/tokio/tests/fs_copy.rs +41 -0
- data/rust-vendor/tokio/tests/fs_dir.rs +126 -0
- data/rust-vendor/tokio/tests/fs_file.rs +289 -0
- data/rust-vendor/tokio/tests/fs_link.rs +62 -0
- data/rust-vendor/tokio/tests/fs_open_options.rs +84 -0
- data/rust-vendor/tokio/tests/fs_open_options_windows.rs +51 -0
- data/rust-vendor/tokio/tests/fs_remove_dir_all.rs +31 -0
- data/rust-vendor/tokio/tests/fs_remove_file.rs +24 -0
- data/rust-vendor/tokio/tests/fs_rename.rs +28 -0
- data/rust-vendor/tokio/tests/fs_symlink_dir_windows.rs +31 -0
- data/rust-vendor/tokio/tests/fs_symlink_file_windows.rs +24 -0
- data/rust-vendor/tokio/tests/fs_try_exists.rs +48 -0
- data/rust-vendor/tokio/tests/fs_uring.rs +157 -0
- data/rust-vendor/tokio/tests/fs_uring_read.rs +202 -0
- data/rust-vendor/tokio/tests/fs_write.rs +16 -0
- data/rust-vendor/tokio/tests/io_async_fd.rs +958 -0
- data/rust-vendor/tokio/tests/io_async_read.rs +10 -0
- data/rust-vendor/tokio/tests/io_buf_reader.rs +379 -0
- data/rust-vendor/tokio/tests/io_buf_writer.rs +537 -0
- data/rust-vendor/tokio/tests/io_chain.rs +16 -0
- data/rust-vendor/tokio/tests/io_copy.rs +101 -0
- data/rust-vendor/tokio/tests/io_copy_bidirectional.rs +168 -0
- data/rust-vendor/tokio/tests/io_driver.rs +105 -0
- data/rust-vendor/tokio/tests/io_driver_drop.rs +62 -0
- data/rust-vendor/tokio/tests/io_fill_buf.rs +34 -0
- data/rust-vendor/tokio/tests/io_join.rs +81 -0
- data/rust-vendor/tokio/tests/io_lines.rs +19 -0
- data/rust-vendor/tokio/tests/io_mem_stream.rs +121 -0
- data/rust-vendor/tokio/tests/io_panic.rs +222 -0
- data/rust-vendor/tokio/tests/io_poll_aio.rs +339 -0
- data/rust-vendor/tokio/tests/io_read.rs +75 -0
- data/rust-vendor/tokio/tests/io_read_buf.rs +94 -0
- data/rust-vendor/tokio/tests/io_read_exact.rs +15 -0
- data/rust-vendor/tokio/tests/io_read_line.rs +107 -0
- data/rust-vendor/tokio/tests/io_read_to_end.rs +125 -0
- data/rust-vendor/tokio/tests/io_read_to_string.rs +63 -0
- data/rust-vendor/tokio/tests/io_read_until.rs +74 -0
- data/rust-vendor/tokio/tests/io_repeat.rs +18 -0
- data/rust-vendor/tokio/tests/io_sink.rs +44 -0
- data/rust-vendor/tokio/tests/io_split.rs +114 -0
- data/rust-vendor/tokio/tests/io_take.rs +74 -0
- data/rust-vendor/tokio/tests/io_util_empty.rs +61 -0
- data/rust-vendor/tokio/tests/io_write.rs +58 -0
- data/rust-vendor/tokio/tests/io_write_all.rs +51 -0
- data/rust-vendor/tokio/tests/io_write_all_buf.rs +145 -0
- data/rust-vendor/tokio/tests/io_write_buf.rs +56 -0
- data/rust-vendor/tokio/tests/io_write_int.rs +37 -0
- data/rust-vendor/tokio/tests/join_handle_panic.rs +21 -0
- data/rust-vendor/tokio/tests/macros_join.rs +256 -0
- data/rust-vendor/tokio/tests/macros_pin.rs +21 -0
- data/rust-vendor/tokio/tests/macros_rename_test.rs +35 -0
- data/rust-vendor/tokio/tests/macros_select.rs +760 -0
- data/rust-vendor/tokio/tests/macros_test.rs +117 -0
- data/rust-vendor/tokio/tests/macros_try_join.rs +269 -0
- data/rust-vendor/tokio/tests/net_bind_resource.rs +14 -0
- data/rust-vendor/tokio/tests/net_lookup_host.rs +39 -0
- data/rust-vendor/tokio/tests/net_named_pipe.rs +399 -0
- data/rust-vendor/tokio/tests/net_panic.rs +196 -0
- data/rust-vendor/tokio/tests/net_quickack.rs +71 -0
- data/rust-vendor/tokio/tests/net_unix_pipe.rs +546 -0
- data/rust-vendor/tokio/tests/no_rt.rs +47 -0
- data/rust-vendor/tokio/tests/process_arg0.rs +13 -0
- data/rust-vendor/tokio/tests/process_change_of_runtime.rs +34 -0
- data/rust-vendor/tokio/tests/process_issue_2174.rs +46 -0
- data/rust-vendor/tokio/tests/process_issue_42.rs +39 -0
- data/rust-vendor/tokio/tests/process_issue_7144.rs +28 -0
- data/rust-vendor/tokio/tests/process_kill_after_wait.rs +27 -0
- data/rust-vendor/tokio/tests/process_kill_on_drop.rs +44 -0
- data/rust-vendor/tokio/tests/process_raw_handle.rs +24 -0
- data/rust-vendor/tokio/tests/process_smoke.rs +34 -0
- data/rust-vendor/tokio/tests/rt_basic.rs +458 -0
- data/rust-vendor/tokio/tests/rt_common.rs +1438 -0
- data/rust-vendor/tokio/tests/rt_handle.rs +125 -0
- data/rust-vendor/tokio/tests/rt_handle_block_on.rs +567 -0
- data/rust-vendor/tokio/tests/rt_local.rs +170 -0
- data/rust-vendor/tokio/tests/rt_metrics.rs +233 -0
- data/rust-vendor/tokio/tests/rt_panic.rs +90 -0
- data/rust-vendor/tokio/tests/rt_poll_callbacks.rs +128 -0
- data/rust-vendor/tokio/tests/rt_threaded.rs +884 -0
- data/rust-vendor/tokio/tests/rt_time_start_paused.rs +14 -0
- data/rust-vendor/tokio/tests/rt_unstable_metrics.rs +821 -0
- data/rust-vendor/tokio/tests/signal_ctrl_c.rs +23 -0
- data/rust-vendor/tokio/tests/signal_drop_recv.rs +23 -0
- data/rust-vendor/tokio/tests/signal_drop_rt.rs +45 -0
- data/rust-vendor/tokio/tests/signal_drop_signal.rs +27 -0
- data/rust-vendor/tokio/tests/signal_info.rs +35 -0
- data/rust-vendor/tokio/tests/signal_multi_rt.rs +55 -0
- data/rust-vendor/tokio/tests/signal_no_rt.rs +13 -0
- data/rust-vendor/tokio/tests/signal_notify_both.rs +24 -0
- data/rust-vendor/tokio/tests/signal_panic.rs +31 -0
- data/rust-vendor/tokio/tests/signal_realtime.rs +105 -0
- data/rust-vendor/tokio/tests/signal_twice.rs +23 -0
- data/rust-vendor/tokio/tests/signal_usr1.rs +24 -0
- data/rust-vendor/tokio/tests/support/io_vec.rs +45 -0
- data/rust-vendor/tokio/tests/support/leaked_buffers.rs +26 -0
- data/rust-vendor/tokio/tests/support/mpsc_stream.rs +42 -0
- data/rust-vendor/tokio/tests/support/panic.rs +34 -0
- data/rust-vendor/tokio/tests/support/signal.rs +15 -0
- data/rust-vendor/tokio/tests/sync_barrier.rs +99 -0
- data/rust-vendor/tokio/tests/sync_broadcast.rs +722 -0
- data/rust-vendor/tokio/tests/sync_broadcast_weak.rs +181 -0
- data/rust-vendor/tokio/tests/sync_errors.rs +30 -0
- data/rust-vendor/tokio/tests/sync_mpsc.rs +1512 -0
- data/rust-vendor/tokio/tests/sync_mpsc_weak.rs +688 -0
- data/rust-vendor/tokio/tests/sync_mutex.rs +178 -0
- data/rust-vendor/tokio/tests/sync_mutex_owned.rs +137 -0
- data/rust-vendor/tokio/tests/sync_notify.rs +303 -0
- data/rust-vendor/tokio/tests/sync_notify_owned.rs +304 -0
- data/rust-vendor/tokio/tests/sync_once_cell.rs +250 -0
- data/rust-vendor/tokio/tests/sync_oneshot.rs +440 -0
- data/rust-vendor/tokio/tests/sync_panic.rs +231 -0
- data/rust-vendor/tokio/tests/sync_rwlock.rs +332 -0
- data/rust-vendor/tokio/tests/sync_semaphore.rs +176 -0
- data/rust-vendor/tokio/tests/sync_semaphore_owned.rs +164 -0
- data/rust-vendor/tokio/tests/sync_set_once.rs +180 -0
- data/rust-vendor/tokio/tests/sync_watch.rs +505 -0
- data/rust-vendor/tokio/tests/task_abort.rs +326 -0
- data/rust-vendor/tokio/tests/task_blocking.rs +310 -0
- data/rust-vendor/tokio/tests/task_builder.rs +105 -0
- data/rust-vendor/tokio/tests/task_hooks.rs +194 -0
- data/rust-vendor/tokio/tests/task_id.rs +300 -0
- data/rust-vendor/tokio/tests/task_join_set.rs +662 -0
- data/rust-vendor/tokio/tests/task_local.rs +171 -0
- data/rust-vendor/tokio/tests/task_local_set.rs +808 -0
- data/rust-vendor/tokio/tests/task_panic.rs +123 -0
- data/rust-vendor/tokio/tests/task_trace_self.rs +107 -0
- data/rust-vendor/tokio/tests/task_yield_now.rs +24 -0
- data/rust-vendor/tokio/tests/tcp_accept.rs +157 -0
- data/rust-vendor/tokio/tests/tcp_connect.rs +231 -0
- data/rust-vendor/tokio/tests/tcp_echo.rs +43 -0
- data/rust-vendor/tokio/tests/tcp_into_split.rs +132 -0
- data/rust-vendor/tokio/tests/tcp_into_std.rs +46 -0
- data/rust-vendor/tokio/tests/tcp_peek.rs +37 -0
- data/rust-vendor/tokio/tests/tcp_shutdown.rs +83 -0
- data/rust-vendor/tokio/tests/tcp_socket.rs +185 -0
- data/rust-vendor/tokio/tests/tcp_split.rs +43 -0
- data/rust-vendor/tokio/tests/tcp_stream.rs +407 -0
- data/rust-vendor/tokio/tests/test_clock.rs +50 -0
- data/rust-vendor/tokio/tests/time_alt.rs +108 -0
- data/rust-vendor/tokio/tests/time_interval.rs +477 -0
- data/rust-vendor/tokio/tests/time_panic.rs +139 -0
- data/rust-vendor/tokio/tests/time_pause.rs +333 -0
- data/rust-vendor/tokio/tests/time_rt.rs +166 -0
- data/rust-vendor/tokio/tests/time_sleep.rs +366 -0
- data/rust-vendor/tokio/tests/time_timeout.rs +151 -0
- data/rust-vendor/tokio/tests/time_wasm.rs +40 -0
- data/rust-vendor/tokio/tests/tracing_sync.rs +282 -0
- data/rust-vendor/tokio/tests/tracing_task.rs +186 -0
- data/rust-vendor/tokio/tests/tracing_time.rs +71 -0
- data/rust-vendor/tokio/tests/udp.rs +724 -0
- data/rust-vendor/tokio/tests/uds_cred.rs +26 -0
- data/rust-vendor/tokio/tests/uds_datagram.rs +425 -0
- data/rust-vendor/tokio/tests/uds_socket.rs +121 -0
- data/rust-vendor/tokio/tests/uds_split.rs +44 -0
- data/rust-vendor/tokio/tests/uds_stream.rs +446 -0
- data/rust-vendor/tokio/tests/unwindsafe.rs +42 -0
- data/rust-vendor/wasip2/.cargo-checksum.json +1 -1
- data/rust-vendor/wasip2/.cargo_vcs_info.json +1 -1
- data/rust-vendor/wasip2/Cargo.lock +9 -9
- data/rust-vendor/wasip2/Cargo.toml +3 -3
- data/rust-vendor/wasip2/Cargo.toml.orig +1 -1
- data/rust-vendor/wasip2/src/command.rs +95 -95
- data/rust-vendor/wasip2/src/imports.rs +283 -296
- data/rust-vendor/wasip2/src/proxy.rs +846 -842
- data/rust-vendor/wasip2/wit/deps/cli.wit +233 -0
- data/rust-vendor/wasip2/wit/deps/clocks.wit +162 -0
- data/rust-vendor/wasip2/wit/deps/filesystem.wit +587 -0
- data/rust-vendor/wasip2/wit/deps/http.wit +733 -0
- data/rust-vendor/wasip2/wit/deps/io.wit +299 -0
- data/rust-vendor/wasip2/wit/deps/random.wit +92 -0
- data/rust-vendor/wasip2/wit/deps/sockets.wit +949 -0
- data/rust-vendor/wasm-bindgen/.cargo-checksum.json +1 -1
- data/rust-vendor/wasm-bindgen/.cargo_vcs_info.json +1 -1
- data/rust-vendor/wasm-bindgen/Cargo.lock +21 -21
- data/rust-vendor/wasm-bindgen/Cargo.toml +6 -3
- data/rust-vendor/wasm-bindgen/Cargo.toml.orig +6 -4
- data/rust-vendor/wasm-bindgen/src/cast.rs +5 -1
- data/rust-vendor/wasm-bindgen/src/closure.rs +695 -245
- data/rust-vendor/wasm-bindgen/src/convert/closures.rs +324 -27
- data/rust-vendor/wasm-bindgen/src/convert/impls.rs +203 -5
- data/rust-vendor/wasm-bindgen/src/convert/slices.rs +36 -10
- data/rust-vendor/wasm-bindgen/src/convert/traits.rs +172 -1
- data/rust-vendor/wasm-bindgen/src/describe.rs +2 -2
- data/rust-vendor/wasm-bindgen/src/lib.rs +28 -7
- data/rust-vendor/wasm-bindgen/src/rt/marker.rs +104 -0
- data/rust-vendor/wasm-bindgen/src/rt/mod.rs +48 -47
- data/rust-vendor/wasm-bindgen/src/sys.rs +272 -0
- data/rust-vendor/wasm-bindgen-macro/.cargo-checksum.json +1 -1
- data/rust-vendor/wasm-bindgen-macro/.cargo_vcs_info.json +1 -1
- data/rust-vendor/wasm-bindgen-macro/Cargo.lock +27 -27
- data/rust-vendor/wasm-bindgen-macro/Cargo.toml +5 -2
- data/rust-vendor/wasm-bindgen-macro/Cargo.toml.orig +2 -2
- data/rust-vendor/wasm-bindgen-macro-support/.cargo-checksum.json +1 -1
- data/rust-vendor/wasm-bindgen-macro-support/.cargo_vcs_info.json +1 -1
- data/rust-vendor/wasm-bindgen-macro-support/Cargo.lock +13 -13
- data/rust-vendor/wasm-bindgen-macro-support/Cargo.toml +6 -2
- data/rust-vendor/wasm-bindgen-macro-support/Cargo.toml.orig +3 -3
- data/rust-vendor/wasm-bindgen-macro-support/src/ast.rs +14 -1
- data/rust-vendor/wasm-bindgen-macro-support/src/codegen.rs +789 -98
- data/rust-vendor/wasm-bindgen-macro-support/src/encode.rs +2 -0
- data/rust-vendor/wasm-bindgen-macro-support/src/generics.rs +805 -0
- data/rust-vendor/wasm-bindgen-macro-support/src/lib.rs +1 -0
- data/rust-vendor/wasm-bindgen-macro-support/src/parser.rs +209 -54
- data/rust-vendor/wasm-bindgen-shared/.cargo-checksum.json +1 -1
- data/rust-vendor/wasm-bindgen-shared/.cargo_vcs_info.json +1 -1
- data/rust-vendor/wasm-bindgen-shared/Cargo.lock +3 -3
- data/rust-vendor/wasm-bindgen-shared/Cargo.toml +4 -1
- data/rust-vendor/wasm-bindgen-shared/Cargo.toml.orig +1 -1
- data/rust-vendor/wasm-bindgen-shared/src/lib.rs +39 -1
- data/rust-vendor/wasm-bindgen-shared/src/schema_hash_approval.rs +1 -1
- data/rust-vendor/zerocopy/.cargo-checksum.json +1 -1
- data/rust-vendor/zerocopy/.cargo_vcs_info.json +1 -1
- data/rust-vendor/zerocopy/Cargo.lock +3 -188
- data/rust-vendor/zerocopy/Cargo.toml +7 -11
- data/rust-vendor/zerocopy/Cargo.toml.orig +5 -10
- data/rust-vendor/zerocopy/cargo.sh +2 -0
- data/rust-vendor/zerocopy/ci/check_fmt.sh +7 -6
- data/rust-vendor/zerocopy/ci/check_stale_stderr.sh +9 -0
- data/rust-vendor/zerocopy/ci/check_todo.sh +8 -1
- data/rust-vendor/zerocopy/githooks/pre-push +3 -3
- data/rust-vendor/zerocopy/src/macros.rs +4 -0
- data/rust-vendor/zerocopy/src/util/macro_util.rs +26 -11
- data/rust-vendor/zerocopy/tests/ui/diagnostic-not-implemented.msrv.stderr +99 -0
- data/rust-vendor/zerocopy/tests/ui/diagnostic-not-implemented.nightly.stderr +249 -0
- data/rust-vendor/zerocopy/tests/ui/diagnostic-not-implemented.rs +83 -0
- data/rust-vendor/zerocopy/tests/ui/diagnostic-not-implemented.stable.stderr +249 -0
- data/rust-vendor/zerocopy/tests/ui/include_value.msrv.stderr +19 -0
- data/rust-vendor/zerocopy/tests/ui/include_value.nightly.stderr +35 -0
- data/rust-vendor/zerocopy/tests/ui/include_value.rs +18 -0
- data/rust-vendor/zerocopy/tests/ui/include_value.stable.stderr +35 -0
- data/rust-vendor/zerocopy/tests/ui/late-compile-pass.msrv.stderr +135 -0
- data/rust-vendor/zerocopy/tests/ui/late-compile-pass.nightly.stderr +157 -0
- data/rust-vendor/zerocopy/tests/ui/late-compile-pass.rs +79 -0
- data/rust-vendor/zerocopy/tests/ui/late-compile-pass.stable.stderr +157 -0
- data/rust-vendor/zerocopy/tests/ui/max-align.msrv.stderr +9 -0
- data/rust-vendor/zerocopy/tests/ui/max-align.nightly.stderr +9 -0
- data/rust-vendor/zerocopy/tests/ui/max-align.rs +102 -0
- data/rust-vendor/zerocopy/tests/ui/max-align.stable.stderr +9 -0
- data/rust-vendor/zerocopy/tests/ui/ptr-is-invariant-over-v.msrv.stderr +21 -0
- data/rust-vendor/zerocopy/tests/ui/ptr-is-invariant-over-v.nightly.stderr +34 -0
- data/rust-vendor/zerocopy/tests/ui/ptr-is-invariant-over-v.rs +35 -0
- data/rust-vendor/zerocopy/tests/ui/ptr-is-invariant-over-v.stable.stderr +34 -0
- data/rust-vendor/zerocopy/tests/ui/transmute-ptr-to-usize.msrv.stderr +19 -0
- data/rust-vendor/zerocopy/tests/ui/transmute-ptr-to-usize.nightly.stderr +33 -0
- data/rust-vendor/zerocopy/tests/ui/transmute-ptr-to-usize.rs +22 -0
- data/rust-vendor/zerocopy/tests/ui/transmute-ptr-to-usize.stable.stderr +28 -0
- data/rust-vendor/zerocopy/tests/ui/transmute.msrv.stderr +35 -0
- data/rust-vendor/zerocopy/tests/ui/transmute.nightly.stderr +70 -0
- data/rust-vendor/zerocopy/tests/ui/transmute.rs +22 -0
- data/rust-vendor/zerocopy/tests/ui/transmute.stable.stderr +70 -0
- data/rust-vendor/zerocopy/tests/ui/transmute_mut.msrv.stderr +111 -0
- data/rust-vendor/zerocopy/tests/ui/transmute_mut.nightly.stderr +213 -0
- data/rust-vendor/zerocopy/tests/ui/transmute_mut.rs +89 -0
- data/rust-vendor/zerocopy/tests/ui/transmute_mut.stable.stderr +213 -0
- data/rust-vendor/zerocopy/tests/ui/transmute_ref.msrv.stderr +245 -0
- data/rust-vendor/zerocopy/tests/ui/transmute_ref.nightly.stderr +359 -0
- data/rust-vendor/zerocopy/tests/ui/transmute_ref.rs +86 -0
- data/rust-vendor/zerocopy/tests/ui/transmute_ref.stable.stderr +359 -0
- data/rust-vendor/zerocopy/tests/ui/try_transmute.msrv.stderr +54 -0
- data/rust-vendor/zerocopy/tests/ui/try_transmute.nightly.stderr +124 -0
- data/rust-vendor/zerocopy/tests/ui/try_transmute.rs +23 -0
- data/rust-vendor/zerocopy/tests/ui/try_transmute.stable.stderr +124 -0
- data/rust-vendor/zerocopy/tests/ui/try_transmute_mut.msrv.stderr +76 -0
- data/rust-vendor/zerocopy/tests/ui/try_transmute_mut.nightly.stderr +252 -0
- data/rust-vendor/zerocopy/tests/ui/try_transmute_mut.rs +49 -0
- data/rust-vendor/zerocopy/tests/ui/try_transmute_mut.stable.stderr +252 -0
- data/rust-vendor/zerocopy/tests/ui/try_transmute_ref.msrv.stderr +84 -0
- data/rust-vendor/zerocopy/tests/ui/try_transmute_ref.nightly.stderr +206 -0
- data/rust-vendor/zerocopy/tests/ui/try_transmute_ref.rs +36 -0
- data/rust-vendor/zerocopy/tests/ui/try_transmute_ref.stable.stderr +206 -0
- data/rust-vendor/zerocopy/tests/ui.rs +34 -0
- data/rust-vendor/zerocopy-derive/.cargo-checksum.json +1 -1
- data/rust-vendor/zerocopy-derive/.cargo_vcs_info.json +1 -1
- data/rust-vendor/zerocopy-derive/Cargo.lock +1 -180
- data/rust-vendor/zerocopy-derive/Cargo.toml +3 -13
- data/rust-vendor/zerocopy-derive/Cargo.toml.orig +1 -8
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_enum.repr(C).expected.rs +40 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_enum.repr(i128).expected.rs +40 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_enum.repr(i16).expected.rs +40 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_enum.repr(i32).expected.rs +40 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_enum.repr(i64).expected.rs +40 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_enum.repr(i8).expected.rs +40 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_enum.repr(isize).expected.rs +40 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_enum.repr(u128).expected.rs +40 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_enum.repr(u16).expected.rs +40 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_enum.repr(u32).expected.rs +40 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_enum.repr(u64).expected.rs +40 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_enum.repr(u8).expected.rs +40 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_enum.repr(usize).expected.rs +40 -0
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_struct_basic.expected.rs +10 -1
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_struct_trailing.expected.rs +10 -1
- data/rust-vendor/zerocopy-derive/src/output_tests/mod.rs +4 -4
- data/rust-vendor/zerocopy-derive/src/util.rs +24 -5
- data/rust-vendor/zerocopy-derive/tests/enum_to_bytes.rs +9 -0
- data/rust-vendor/zerocopy-derive/tests/struct_to_bytes.rs +9 -0
- data/rust-vendor/zerocopy-derive/tests/ui/absence_of_deprecated_warning.msrv.stderr +14 -0
- data/rust-vendor/zerocopy-derive/tests/ui/absence_of_deprecated_warning.nightly.stderr +28 -0
- data/rust-vendor/zerocopy-derive/tests/ui/absence_of_deprecated_warning.rs +35 -0
- data/rust-vendor/zerocopy-derive/tests/ui/absence_of_deprecated_warning.stable.stderr +28 -0
- data/rust-vendor/zerocopy-derive/tests/ui/cfgs/union_into_bytes_cfg.msrv.stderr +15 -0
- data/rust-vendor/zerocopy-derive/tests/ui/derive_transparent.msrv.stderr +93 -0
- data/rust-vendor/zerocopy-derive/tests/ui/derive_transparent.nightly.stderr +198 -0
- data/rust-vendor/zerocopy-derive/tests/ui/derive_transparent.rs +48 -0
- data/rust-vendor/zerocopy-derive/tests/ui/derive_transparent.stable.stderr +173 -0
- data/rust-vendor/zerocopy-derive/tests/ui/enum.msrv.stderr +419 -0
- data/rust-vendor/zerocopy-derive/tests/ui/enum.nightly.stderr +601 -0
- data/rust-vendor/zerocopy-derive/tests/ui/enum.rs +688 -0
- data/rust-vendor/zerocopy-derive/tests/ui/enum.stable.stderr +549 -0
- data/rust-vendor/zerocopy-derive/tests/ui/enum_from_bytes_u8_too_few.msrv.stderr +14 -0
- data/rust-vendor/zerocopy-derive/tests/ui/enum_from_bytes_u8_too_few.nightly.stderr +14 -0
- data/rust-vendor/zerocopy-derive/tests/ui/enum_from_bytes_u8_too_few.rs +274 -0
- data/rust-vendor/zerocopy-derive/tests/ui/enum_from_bytes_u8_too_few.stable.stderr +14 -0
- data/rust-vendor/zerocopy-derive/tests/ui/late_compile_pass.msrv.stderr +101 -0
- data/rust-vendor/zerocopy-derive/tests/ui/late_compile_pass.nightly.stderr +335 -0
- data/rust-vendor/zerocopy-derive/tests/ui/late_compile_pass.rs +108 -0
- data/rust-vendor/zerocopy-derive/tests/ui/late_compile_pass.stable.stderr +295 -0
- data/rust-vendor/zerocopy-derive/tests/ui/mid_compile_pass.msrv.stderr +101 -0
- data/rust-vendor/zerocopy-derive/tests/ui/mid_compile_pass.nightly.stderr +114 -0
- data/rust-vendor/zerocopy-derive/tests/ui/mid_compile_pass.rs +70 -0
- data/rust-vendor/zerocopy-derive/tests/ui/mid_compile_pass.stable.stderr +114 -0
- data/rust-vendor/zerocopy-derive/tests/ui/msrv_specific.msrv.stderr +29 -0
- data/rust-vendor/zerocopy-derive/tests/ui/msrv_specific.nightly.stderr +45 -0
- data/rust-vendor/zerocopy-derive/tests/ui/msrv_specific.rs +40 -0
- data/rust-vendor/zerocopy-derive/tests/ui/msrv_specific.stable.stderr +45 -0
- data/rust-vendor/zerocopy-derive/tests/ui/privacy.msrv.stderr +147 -0
- data/rust-vendor/zerocopy-derive/tests/ui/privacy.nightly.stderr +32 -0
- data/rust-vendor/zerocopy-derive/tests/ui/privacy.rs +160 -0
- data/rust-vendor/zerocopy-derive/tests/ui/privacy.stable.stderr +32 -0
- data/rust-vendor/zerocopy-derive/tests/ui/struct.msrv.stderr +87 -0
- data/rust-vendor/zerocopy-derive/tests/ui/struct.nightly.stderr +554 -0
- data/rust-vendor/zerocopy-derive/tests/ui/struct.rs +339 -0
- data/rust-vendor/zerocopy-derive/tests/ui/struct.stable.stderr +522 -0
- data/rust-vendor/zerocopy-derive/tests/ui/union.msrv.stderr +88 -0
- data/rust-vendor/zerocopy-derive/tests/ui/union.nightly.stderr +130 -0
- data/rust-vendor/zerocopy-derive/tests/ui/union.rs +134 -0
- data/rust-vendor/zerocopy-derive/tests/ui/union.stable.stderr +125 -0
- data/rust-vendor/zerocopy-derive/tests/ui.rs +28 -0
- data/rust-vendor/zerocopy-derive/tests/union_to_bytes.rs +9 -0
- metadata +1263 -458
- data/ext/html-to-markdown-rb/native/Cargo.lock +0 -1591
- data/rust-vendor/futf/.cargo-checksum.json +0 -1
- data/rust-vendor/futf/.cargo_vcs_info.json +0 -6
- data/rust-vendor/futf/.travis.yml +0 -11
- data/rust-vendor/futf/Cargo.toml +0 -24
- data/rust-vendor/futf/Cargo.toml.orig +0 -12
- data/rust-vendor/futf/LICENSE-APACHE +0 -201
- data/rust-vendor/futf/LICENSE-MIT +0 -25
- data/rust-vendor/futf/README.md +0 -18
- data/rust-vendor/futf/src/lib.rs +0 -248
- data/rust-vendor/futf/src/test.rs +0 -270
- data/rust-vendor/html5ever/examples/capi/tokenize.c +0 -74
- data/rust-vendor/mac/.cargo-checksum.json +0 -1
- data/rust-vendor/mac/.travis.yml +0 -19
- data/rust-vendor/mac/Cargo.toml +0 -10
- data/rust-vendor/mac/README.md +0 -27
- data/rust-vendor/mac/src/cfg.rs +0 -90
- data/rust-vendor/mac/src/format.rs +0 -50
- data/rust-vendor/mac/src/inspect.rs +0 -93
- data/rust-vendor/mac/src/lib.rs +0 -71
- data/rust-vendor/mac/src/matches.rs +0 -44
- data/rust-vendor/mac/src/mem.rs +0 -44
- data/rust-vendor/mac/src/syntax_ext.rs +0 -31
- data/rust-vendor/mac/src/test.rs +0 -24
- data/rust-vendor/markup5ever/Cargo.lock +0 -292
- data/rust-vendor/tendril/.github/workflows/main.yml +0 -51
- data/rust-vendor/tendril/src/bench.rs +0 -159
- data/rust-vendor/wasip2/wit/deps/cli/command.wit +0 -10
- data/rust-vendor/wasip2/wit/deps/cli/environment.wit +0 -22
- data/rust-vendor/wasip2/wit/deps/cli/exit.wit +0 -17
- data/rust-vendor/wasip2/wit/deps/cli/imports.wit +0 -36
- data/rust-vendor/wasip2/wit/deps/cli/run.wit +0 -6
- data/rust-vendor/wasip2/wit/deps/cli/stdio.wit +0 -26
- data/rust-vendor/wasip2/wit/deps/cli/terminal.wit +0 -62
- data/rust-vendor/wasip2/wit/deps/clocks/monotonic-clock.wit +0 -50
- data/rust-vendor/wasip2/wit/deps/clocks/timezone.wit +0 -55
- data/rust-vendor/wasip2/wit/deps/clocks/wall-clock.wit +0 -46
- data/rust-vendor/wasip2/wit/deps/clocks/world.wit +0 -11
- data/rust-vendor/wasip2/wit/deps/filesystem/preopens.wit +0 -11
- data/rust-vendor/wasip2/wit/deps/filesystem/types.wit +0 -676
- data/rust-vendor/wasip2/wit/deps/filesystem/world.wit +0 -9
- data/rust-vendor/wasip2/wit/deps/http/handler.wit +0 -49
- data/rust-vendor/wasip2/wit/deps/http/proxy.wit +0 -50
- data/rust-vendor/wasip2/wit/deps/http/types.wit +0 -688
- data/rust-vendor/wasip2/wit/deps/io/error.wit +0 -34
- data/rust-vendor/wasip2/wit/deps/io/poll.wit +0 -47
- data/rust-vendor/wasip2/wit/deps/io/streams.wit +0 -290
- data/rust-vendor/wasip2/wit/deps/io/world.wit +0 -10
- data/rust-vendor/wasip2/wit/deps/random/insecure-seed.wit +0 -27
- data/rust-vendor/wasip2/wit/deps/random/insecure.wit +0 -25
- data/rust-vendor/wasip2/wit/deps/random/random.wit +0 -29
- data/rust-vendor/wasip2/wit/deps/random/world.wit +0 -13
- data/rust-vendor/wasip2/wit/deps/sockets/instance-network.wit +0 -11
- data/rust-vendor/wasip2/wit/deps/sockets/ip-name-lookup.wit +0 -56
- data/rust-vendor/wasip2/wit/deps/sockets/network.wit +0 -169
- data/rust-vendor/wasip2/wit/deps/sockets/tcp-create-socket.wit +0 -30
- data/rust-vendor/wasip2/wit/deps/sockets/tcp.wit +0 -387
- data/rust-vendor/wasip2/wit/deps/sockets/udp-create-socket.wit +0 -30
- data/rust-vendor/wasip2/wit/deps/sockets/udp.wit +0 -288
- data/rust-vendor/wasip2/wit/deps/sockets/world.wit +0 -19
- data/rust-vendor/wit-bindgen-0.46.0/.cargo-checksum.json +0 -1
- data/rust-vendor/wit-bindgen-0.46.0/.cargo_vcs_info.json +0 -6
- data/rust-vendor/wit-bindgen-0.46.0/Cargo.lock +0 -428
- data/rust-vendor/wit-bindgen-0.46.0/Cargo.toml +0 -88
- data/rust-vendor/wit-bindgen-0.46.0/Cargo.toml.orig +0 -37
- data/rust-vendor/wit-bindgen-0.46.0/LICENSE-APACHE +0 -201
- data/rust-vendor/wit-bindgen-0.46.0/LICENSE-Apache-2.0_WITH_LLVM-exception +0 -220
- data/rust-vendor/wit-bindgen-0.46.0/README.md +0 -45
- data/rust-vendor/wit-bindgen-0.46.0/build.rs +0 -32
- data/rust-vendor/wit-bindgen-0.46.0/src/examples/_0_world_imports.rs +0 -17
- data/rust-vendor/wit-bindgen-0.46.0/src/examples/_1_interface_imports.rs +0 -32
- data/rust-vendor/wit-bindgen-0.46.0/src/examples/_2_imported_resources.rs +0 -22
- data/rust-vendor/wit-bindgen-0.46.0/src/examples/_3_world_exports.rs +0 -47
- data/rust-vendor/wit-bindgen-0.46.0/src/examples/_4_exported_resources.rs +0 -26
- data/rust-vendor/wit-bindgen-0.46.0/src/examples.rs +0 -55
- data/rust-vendor/wit-bindgen-0.46.0/src/lib.rs +0 -881
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/abi_buffer.rs +0 -417
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/cabi.rs +0 -112
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/error_context.rs +0 -94
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/future_support.rs +0 -734
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/stream_support.rs +0 -604
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/subtask.rs +0 -289
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/waitable.rs +0 -466
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support/waitable_set.rs +0 -100
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/async_support.rs +0 -634
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/mod.rs +0 -230
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi.c +0 -20
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi.o +0 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi_realloc.c +0 -10
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi_realloc.o +0 -0
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi_realloc.rs +0 -11
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi_wasip3.c +0 -12
- data/rust-vendor/wit-bindgen-0.46.0/src/rt/wit_bindgen_cabi_wasip3.o +0 -0
- data/rust-vendor/wit-bindgen-0.46.0/wasi-cli@0.2.0.wasm +0 -0
- data/rust-vendor/zerocopy/tests/trybuild.rs +0 -40
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-from-bytes.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-from-bytes.stderr +0 -11
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-from-zeros.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-from-zeros.stderr +0 -11
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-immutable.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-immutable.stderr +0 -11
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-into-bytes.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-into-bytes.stderr +0 -11
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-issue-1296.rs +0 -57
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-issue-1296.stderr +0 -11
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-known-layout.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-known-layout.stderr +0 -11
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-try-from-bytes.stderr +0 -11
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-unaligned.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-msrv/diagnostic-not-implemented-unaligned.stderr +0 -11
- data/rust-vendor/zerocopy/tests/ui-msrv/include_value_not_from_bytes.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-msrv/include_value_not_from_bytes.stderr +0 -15
- data/rust-vendor/zerocopy/tests/ui-msrv/include_value_wrong_size.rs +0 -12
- data/rust-vendor/zerocopy/tests/ui-msrv/include_value_wrong_size.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-msrv/max-align.rs +0 -99
- data/rust-vendor/zerocopy/tests/ui-msrv/max-align.stderr +0 -5
- data/rust-vendor/zerocopy/tests/ui-msrv/ptr-is-invariant-over-v.rs +0 -29
- data/rust-vendor/zerocopy/tests/ui-msrv/ptr-is-invariant-over-v.stderr +0 -17
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-dst-not-frombytes.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-dst-not-frombytes.stderr +0 -15
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-const.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-const.stderr +0 -48
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-a-reference.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-a-reference.stderr +0 -19
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-frombytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-frombytes.stderr +0 -7
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-intobytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-dst-not-intobytes.stderr +0 -7
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-illegal-lifetime.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-illegal-lifetime.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-dst-not-references.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-dst-not-references.stderr +0 -12
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-immutable.rs +0 -16
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-immutable.stderr +0 -11
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-a-reference.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-a-reference.stderr +0 -12
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-frombytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-frombytes.stderr +0 -7
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-intobytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-not-intobytes.stderr +0 -7
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-unsized.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-mut-src-unsized.stderr +0 -16
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ptr-to-usize.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ptr-to-usize.stderr +0 -15
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-mutable.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-mutable.stderr +0 -39
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-a-reference.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-a-reference.stderr +0 -39
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-frombytes.rs +0 -21
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-frombytes.stderr +0 -12
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-nocell.rs +0 -21
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-dst-not-nocell.stderr +0 -12
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-illegal-lifetime.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-illegal-lifetime.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-dst-not-references.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-dst-not-references.stderr +0 -52
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-a-reference.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-a-reference.stderr +0 -12
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-intobytes.rs +0 -21
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-intobytes.stderr +0 -25
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-nocell.rs +0 -21
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-not-nocell.stderr +0 -25
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-unsized.rs +0 -14
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-ref-src-unsized.stderr +0 -16
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-decrease.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-decrease.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-increase-allow-shrink.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-increase-allow-shrink.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-increase.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-size-increase.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-src-not-intobytes.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-msrv/transmute-src-not-intobytes.stderr +0 -15
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-dst-not-tryfrombytes.rs +0 -16
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-dst-not-tryfrombytes.stderr +0 -37
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-size-decrease.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-size-decrease.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-size-increase.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-size-increase.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-src-not-intobytes.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute-src-not-intobytes.stderr +0 -12
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-dst-not-tryfrombytes.stderr +0 -40
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-src-not-frombytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-src-not-frombytes.stderr +0 -23
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-src-not-intobytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_mut-src-not-intobytes.stderr +0 -23
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-dst-mutable.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-dst-mutable.stderr +0 -22
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +0 -40
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-msrv/try_transmute_ref-src-not-immutable-intobytes.stderr +0 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-from-bytes.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-from-bytes.stderr +0 -27
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-from-zeros.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-from-zeros.stderr +0 -27
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-immutable.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-immutable.stderr +0 -27
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-into-bytes.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-into-bytes.stderr +0 -27
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-issue-1296.rs +0 -57
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-issue-1296.stderr +0 -49
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-known-layout.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-known-layout.stderr +0 -27
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-try-from-bytes.stderr +0 -27
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-unaligned.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-nightly/diagnostic-not-implemented-unaligned.stderr +0 -27
- data/rust-vendor/zerocopy/tests/ui-nightly/include_value_not_from_bytes.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-nightly/include_value_not_from_bytes.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-nightly/include_value_wrong_size.rs +0 -12
- data/rust-vendor/zerocopy/tests/ui-nightly/include_value_wrong_size.stderr +0 -17
- data/rust-vendor/zerocopy/tests/ui-nightly/max-align.rs +0 -99
- data/rust-vendor/zerocopy/tests/ui-nightly/max-align.stderr +0 -5
- data/rust-vendor/zerocopy/tests/ui-nightly/ptr-is-invariant-over-v.rs +0 -29
- data/rust-vendor/zerocopy/tests/ui-nightly/ptr-is-invariant-over-v.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-dst-not-frombytes.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-dst-not-frombytes.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-const.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-const.stderr +0 -32
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-a-reference.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-a-reference.stderr +0 -19
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-frombytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-frombytes.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-intobytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-dst-not-intobytes.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-illegal-lifetime.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-illegal-lifetime.stderr +0 -12
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-dst-not-references.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-dst-not-references.stderr +0 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-immutable.rs +0 -16
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-immutable.stderr +0 -11
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-a-reference.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-a-reference.stderr +0 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-frombytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-frombytes.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-intobytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-not-intobytes.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-unsized.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-mut-src-unsized.stderr +0 -16
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ptr-to-usize.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ptr-to-usize.stderr +0 -29
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-mutable.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-mutable.stderr +0 -39
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-a-reference.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-a-reference.stderr +0 -39
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-frombytes.rs +0 -21
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-frombytes.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-nocell.rs +0 -21
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-dst-not-nocell.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-illegal-lifetime.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-illegal-lifetime.stderr +0 -12
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-dst-not-references.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-dst-not-references.stderr +0 -55
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-a-reference.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-a-reference.stderr +0 -15
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-intobytes.rs +0 -21
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-intobytes.stderr +0 -60
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-nocell.rs +0 -21
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-not-nocell.stderr +0 -60
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-unsized.rs +0 -14
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-ref-src-unsized.stderr +0 -16
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-decrease.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-decrease.stderr +0 -17
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-increase-allow-shrink.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-increase-allow-shrink.stderr +0 -17
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-increase.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-size-increase.stderr +0 -17
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-src-not-intobytes.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-nightly/transmute-src-not-intobytes.stderr +0 -34
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-dst-not-tryfrombytes.rs +0 -16
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-dst-not-tryfrombytes.stderr +0 -88
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-size-decrease.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-size-decrease.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-size-increase.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-size-increase.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-src-not-intobytes.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute-src-not-intobytes.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-dst-not-tryfrombytes.stderr +0 -120
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-src-not-frombytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-src-not-frombytes.stderr +0 -95
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-src-not-intobytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_mut-src-not-intobytes.stderr +0 -95
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-dst-mutable.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-dst-mutable.stderr +0 -32
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +0 -120
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-nightly/try_transmute_ref-src-not-immutable-intobytes.stderr +0 -63
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-from-bytes.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-from-bytes.stderr +0 -27
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-from-zeros.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-from-zeros.stderr +0 -27
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-immutable.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-immutable.stderr +0 -27
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-into-bytes.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-into-bytes.stderr +0 -27
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-issue-1296.rs +0 -57
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-issue-1296.stderr +0 -49
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-known-layout.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-known-layout.stderr +0 -27
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-try-from-bytes.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-try-from-bytes.stderr +0 -27
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-unaligned.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-stable/diagnostic-not-implemented-unaligned.stderr +0 -27
- data/rust-vendor/zerocopy/tests/ui-stable/include_value_not_from_bytes.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-stable/include_value_not_from_bytes.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-stable/include_value_wrong_size.rs +0 -12
- data/rust-vendor/zerocopy/tests/ui-stable/include_value_wrong_size.stderr +0 -17
- data/rust-vendor/zerocopy/tests/ui-stable/max-align.rs +0 -99
- data/rust-vendor/zerocopy/tests/ui-stable/max-align.stderr +0 -5
- data/rust-vendor/zerocopy/tests/ui-stable/ptr-is-invariant-over-v.rs +0 -29
- data/rust-vendor/zerocopy/tests/ui-stable/ptr-is-invariant-over-v.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-dst-not-frombytes.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-dst-not-frombytes.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-const.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-const.stderr +0 -32
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-a-reference.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-a-reference.stderr +0 -19
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-frombytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-frombytes.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-intobytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-dst-not-intobytes.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-illegal-lifetime.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-illegal-lifetime.stderr +0 -12
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-dst-not-references.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-dst-not-references.stderr +0 -15
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-immutable.rs +0 -16
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-immutable.stderr +0 -11
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-a-reference.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-a-reference.stderr +0 -15
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-frombytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-frombytes.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-intobytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-not-intobytes.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-unsized.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-mut-src-unsized.stderr +0 -16
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ptr-to-usize.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ptr-to-usize.stderr +0 -24
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-mutable.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-mutable.stderr +0 -39
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-a-reference.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-a-reference.stderr +0 -39
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-frombytes.rs +0 -21
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-frombytes.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-nocell.rs +0 -21
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-dst-not-nocell.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-illegal-lifetime.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-illegal-lifetime.stderr +0 -12
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-dst-not-references.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-dst-not-references.stderr +0 -55
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-a-reference.rs +0 -15
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-a-reference.stderr +0 -15
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-intobytes.rs +0 -21
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-intobytes.stderr +0 -60
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-nocell.rs +0 -21
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-not-nocell.stderr +0 -60
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-unsized.rs +0 -14
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-ref-src-unsized.stderr +0 -16
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-decrease.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-decrease.stderr +0 -17
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-increase-allow-shrink.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-increase-allow-shrink.stderr +0 -17
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-increase.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-size-increase.stderr +0 -17
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-src-not-intobytes.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-stable/transmute-src-not-intobytes.stderr +0 -34
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-dst-not-tryfrombytes.rs +0 -16
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-dst-not-tryfrombytes.stderr +0 -88
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-size-decrease.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-size-decrease.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-size-increase.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-size-increase.stderr +0 -9
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-src-not-intobytes.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute-src-not-intobytes.stderr +0 -31
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.rs +0 -19
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-dst-not-tryfrombytes.stderr +0 -120
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-src-not-frombytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-src-not-frombytes.stderr +0 -95
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-src-not-intobytes.rs +0 -22
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_mut-src-not-intobytes.stderr +0 -95
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-dst-mutable.rs +0 -17
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-dst-mutable.stderr +0 -32
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-dst-not-immutable-tryfrombytes.stderr +0 -120
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-src-not-immutable-intobytes.rs +0 -18
- data/rust-vendor/zerocopy/tests/ui-stable/try_transmute_ref-src-not-immutable-intobytes.stderr +0 -63
- data/rust-vendor/zerocopy-derive/src/output_tests/expected/into_bytes_enum.expected.rs +0 -17
- data/rust-vendor/zerocopy-derive/tests/trybuild.rs +0 -62
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/cfgs/union_into_bytes_cfg.stderr +0 -8
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/derive_transparent.rs +0 -39
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/derive_transparent.stderr +0 -89
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/enum.rs +0 -624
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/enum.stderr +0 -399
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/enum_from_bytes_u8_too_few.rs +0 -273
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/enum_from_bytes_u8_too_few.stderr +0 -11
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/late_compile_pass.rs +0 -92
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/late_compile_pass.stderr +0 -97
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/mid_compile_pass.rs +0 -65
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/mid_compile_pass.stderr +0 -97
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/msrv_specific.rs +0 -39
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/msrv_specific.stderr +0 -25
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/privacy.rs +0 -139
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/privacy.stderr +0 -143
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/struct.rs +0 -286
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/struct.stderr +0 -281
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/union.rs +0 -120
- data/rust-vendor/zerocopy-derive/tests/ui-msrv/union.stderr +0 -84
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/absence_of_deprecated_warning.rs +0 -34
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/absence_of_deprecated_warning.stderr +0 -11
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/cfgs/on_error.rs +0 -19
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/cfgs/union_into_bytes_cfg.rs +0 -27
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/derive_transparent.rs +0 -39
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/derive_transparent.stderr +0 -194
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/enum.rs +0 -624
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/enum.stderr +0 -578
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/enum_from_bytes_u8_too_few.rs +0 -273
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/enum_from_bytes_u8_too_few.stderr +0 -11
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/late_compile_pass.rs +0 -92
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/late_compile_pass.stderr +0 -331
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/mid_compile_pass.rs +0 -65
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/mid_compile_pass.stderr +0 -109
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/privacy.rs +0 -139
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/privacy.stderr +0 -17
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/struct.rs +0 -286
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/struct.stderr +0 -555
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/union.rs +0 -120
- data/rust-vendor/zerocopy-derive/tests/ui-nightly/union.stderr +0 -128
- data/rust-vendor/zerocopy-derive/tests/ui-stable/cfgs/on_error.rs +0 -19
- data/rust-vendor/zerocopy-derive/tests/ui-stable/cfgs/union_into_bytes_cfg.rs +0 -27
- data/rust-vendor/zerocopy-derive/tests/ui-stable/derive_transparent.rs +0 -39
- data/rust-vendor/zerocopy-derive/tests/ui-stable/derive_transparent.stderr +0 -169
- data/rust-vendor/zerocopy-derive/tests/ui-stable/enum.rs +0 -624
- data/rust-vendor/zerocopy-derive/tests/ui-stable/enum.stderr +0 -523
- data/rust-vendor/zerocopy-derive/tests/ui-stable/enum_from_bytes_u8_too_few.rs +0 -273
- data/rust-vendor/zerocopy-derive/tests/ui-stable/enum_from_bytes_u8_too_few.stderr +0 -11
- data/rust-vendor/zerocopy-derive/tests/ui-stable/late_compile_pass.rs +0 -92
- data/rust-vendor/zerocopy-derive/tests/ui-stable/late_compile_pass.stderr +0 -291
- data/rust-vendor/zerocopy-derive/tests/ui-stable/mid_compile_pass.rs +0 -65
- data/rust-vendor/zerocopy-derive/tests/ui-stable/mid_compile_pass.stderr +0 -109
- data/rust-vendor/zerocopy-derive/tests/ui-stable/privacy.rs +0 -139
- data/rust-vendor/zerocopy-derive/tests/ui-stable/privacy.stderr +0 -17
- data/rust-vendor/zerocopy-derive/tests/ui-stable/struct.rs +0 -286
- data/rust-vendor/zerocopy-derive/tests/ui-stable/struct.stderr +0 -499
- data/rust-vendor/zerocopy-derive/tests/ui-stable/union.rs +0 -120
- data/rust-vendor/zerocopy-derive/tests/ui-stable/union.stderr +0 -120
- /data/rust-vendor/{wit-bindgen-0.46.0 → async-trait}/LICENSE-MIT +0 -0
- /data/rust-vendor/zerocopy-derive/tests/{ui-msrv/cfgs/on_error.stderr → ui/cfgs/on_error.msrv.stderr} +0 -0
- /data/rust-vendor/zerocopy-derive/tests/{ui-nightly/cfgs/on_error.stderr → ui/cfgs/on_error.nightly.stderr} +0 -0
- /data/rust-vendor/zerocopy-derive/tests/{ui-msrv → ui}/cfgs/on_error.rs +0 -0
- /data/rust-vendor/zerocopy-derive/tests/{ui-stable/cfgs/on_error.stderr → ui/cfgs/on_error.stable.stderr} +0 -0
- /data/rust-vendor/zerocopy-derive/tests/{ui-nightly/cfgs/union_into_bytes_cfg.stderr → ui/cfgs/union_into_bytes_cfg.nightly.stderr} +0 -0
- /data/rust-vendor/zerocopy-derive/tests/{ui-msrv → ui}/cfgs/union_into_bytes_cfg.rs +0 -0
- /data/rust-vendor/zerocopy-derive/tests/{ui-stable/cfgs/union_into_bytes_cfg.stderr → ui/cfgs/union_into_bytes_cfg.stable.stderr} +0 -0
|
@@ -0,0 +1,2699 @@
|
|
|
1
|
+
//! Tokio support for [Windows named pipes].
|
|
2
|
+
//!
|
|
3
|
+
//! [Windows named pipes]: https://docs.microsoft.com/en-us/windows/win32/ipc/named-pipes
|
|
4
|
+
|
|
5
|
+
use std::ffi::c_void;
|
|
6
|
+
use std::ffi::OsStr;
|
|
7
|
+
use std::io::{self, Read, Write};
|
|
8
|
+
use std::pin::Pin;
|
|
9
|
+
use std::ptr;
|
|
10
|
+
use std::ptr::null_mut;
|
|
11
|
+
use std::task::{Context, Poll};
|
|
12
|
+
|
|
13
|
+
use crate::io::{AsyncRead, AsyncWrite, Interest, PollEvented, ReadBuf, Ready};
|
|
14
|
+
use crate::os::windows::io::{AsHandle, AsRawHandle, BorrowedHandle, FromRawHandle, RawHandle};
|
|
15
|
+
|
|
16
|
+
cfg_io_util! {
|
|
17
|
+
use bytes::BufMut;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// Hide imports which are not used when generating documentation.
|
|
21
|
+
#[cfg(windows)]
|
|
22
|
+
mod doc {
|
|
23
|
+
pub(super) use crate::os::windows::ffi::OsStrExt;
|
|
24
|
+
pub(super) mod windows_sys {
|
|
25
|
+
pub(crate) use windows_sys::{
|
|
26
|
+
Win32::Foundation::*, Win32::Storage::FileSystem::*, Win32::System::Pipes::*,
|
|
27
|
+
Win32::System::SystemServices::*,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
pub(super) use mio::windows as mio_windows;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// NB: none of these shows up in public API, so don't document them.
|
|
34
|
+
#[cfg(not(windows))]
|
|
35
|
+
mod doc {
|
|
36
|
+
pub(super) mod mio_windows {
|
|
37
|
+
pub type NamedPipe = crate::doc::NotDefinedHere;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
use self::doc::*;
|
|
42
|
+
|
|
43
|
+
/// A [Windows named pipe] server.
|
|
44
|
+
///
|
|
45
|
+
/// Accepting client connections involves creating a server with
|
|
46
|
+
/// [`ServerOptions::create`] and waiting for clients to connect using
|
|
47
|
+
/// [`NamedPipeServer::connect`].
|
|
48
|
+
///
|
|
49
|
+
/// To avoid having clients sporadically fail with
|
|
50
|
+
/// [`std::io::ErrorKind::NotFound`] when they connect to a server, we must
|
|
51
|
+
/// ensure that at least one server instance is available at all times. This
|
|
52
|
+
/// means that the typical listen loop for a server is a bit involved, because
|
|
53
|
+
/// we have to ensure that we never drop a server accidentally while a client
|
|
54
|
+
/// might connect.
|
|
55
|
+
///
|
|
56
|
+
/// So a correctly implemented server looks like this:
|
|
57
|
+
///
|
|
58
|
+
/// ```no_run
|
|
59
|
+
/// use std::io;
|
|
60
|
+
/// use tokio::net::windows::named_pipe::ServerOptions;
|
|
61
|
+
///
|
|
62
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\named-pipe-idiomatic-server";
|
|
63
|
+
///
|
|
64
|
+
/// # #[tokio::main] async fn main() -> std::io::Result<()> {
|
|
65
|
+
/// // The first server needs to be constructed early so that clients can
|
|
66
|
+
/// // be correctly connected. Otherwise calling .wait will cause the client to
|
|
67
|
+
/// // error.
|
|
68
|
+
/// //
|
|
69
|
+
/// // Here we also make use of `first_pipe_instance`, which will ensure that
|
|
70
|
+
/// // there are no other servers up and running already.
|
|
71
|
+
/// let mut server = ServerOptions::new()
|
|
72
|
+
/// .first_pipe_instance(true)
|
|
73
|
+
/// .create(PIPE_NAME)?;
|
|
74
|
+
///
|
|
75
|
+
/// // Spawn the server loop.
|
|
76
|
+
/// let server = tokio::spawn(async move {
|
|
77
|
+
/// loop {
|
|
78
|
+
/// // Wait for a client to connect.
|
|
79
|
+
/// server.connect().await?;
|
|
80
|
+
/// let connected_client = server;
|
|
81
|
+
///
|
|
82
|
+
/// // Construct the next server to be connected before sending the one
|
|
83
|
+
/// // we already have of onto a task. This ensures that the server
|
|
84
|
+
/// // isn't closed (after it's done in the task) before a new one is
|
|
85
|
+
/// // available. Otherwise the client might error with
|
|
86
|
+
/// // `io::ErrorKind::NotFound`.
|
|
87
|
+
/// server = ServerOptions::new().create(PIPE_NAME)?;
|
|
88
|
+
///
|
|
89
|
+
/// let client = tokio::spawn(async move {
|
|
90
|
+
/// /* use the connected client */
|
|
91
|
+
/// # Ok::<_, std::io::Error>(())
|
|
92
|
+
/// });
|
|
93
|
+
/// # if true { break } // needed for type inference to work
|
|
94
|
+
/// }
|
|
95
|
+
///
|
|
96
|
+
/// Ok::<_, io::Error>(())
|
|
97
|
+
/// });
|
|
98
|
+
///
|
|
99
|
+
/// /* do something else not server related here */
|
|
100
|
+
/// # Ok(()) }
|
|
101
|
+
/// ```
|
|
102
|
+
///
|
|
103
|
+
/// [Windows named pipe]: https://docs.microsoft.com/en-us/windows/win32/ipc/named-pipes
|
|
104
|
+
#[derive(Debug)]
|
|
105
|
+
pub struct NamedPipeServer {
|
|
106
|
+
io: PollEvented<mio_windows::NamedPipe>,
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
impl NamedPipeServer {
|
|
110
|
+
/// Constructs a new named pipe server from the specified raw handle.
|
|
111
|
+
///
|
|
112
|
+
/// This function will consume ownership of the handle given, passing
|
|
113
|
+
/// responsibility for closing the handle to the returned object.
|
|
114
|
+
///
|
|
115
|
+
/// This function is also unsafe as the primitives currently returned have
|
|
116
|
+
/// the contract that they are the sole owner of the file descriptor they
|
|
117
|
+
/// are wrapping. Usage of this function could accidentally allow violating
|
|
118
|
+
/// this contract which can cause memory unsafety in code that relies on it
|
|
119
|
+
/// being true.
|
|
120
|
+
///
|
|
121
|
+
/// # Errors
|
|
122
|
+
///
|
|
123
|
+
/// This errors if called outside of a [Tokio Runtime], or in a runtime that
|
|
124
|
+
/// has not [enabled I/O], or if any OS-specific I/O errors occur.
|
|
125
|
+
///
|
|
126
|
+
/// [Tokio Runtime]: crate::runtime::Runtime
|
|
127
|
+
/// [enabled I/O]: crate::runtime::Builder::enable_io
|
|
128
|
+
pub unsafe fn from_raw_handle(handle: RawHandle) -> io::Result<Self> {
|
|
129
|
+
let named_pipe = unsafe { mio_windows::NamedPipe::from_raw_handle(handle) };
|
|
130
|
+
|
|
131
|
+
Ok(Self {
|
|
132
|
+
io: PollEvented::new(named_pipe)?,
|
|
133
|
+
})
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/// Retrieves information about the named pipe the server is associated
|
|
137
|
+
/// with.
|
|
138
|
+
///
|
|
139
|
+
/// ```no_run
|
|
140
|
+
/// use tokio::net::windows::named_pipe::{PipeEnd, PipeMode, ServerOptions};
|
|
141
|
+
///
|
|
142
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-server-info";
|
|
143
|
+
///
|
|
144
|
+
/// # #[tokio::main] async fn main() -> std::io::Result<()> {
|
|
145
|
+
/// let server = ServerOptions::new()
|
|
146
|
+
/// .pipe_mode(PipeMode::Message)
|
|
147
|
+
/// .max_instances(5)
|
|
148
|
+
/// .create(PIPE_NAME)?;
|
|
149
|
+
///
|
|
150
|
+
/// let server_info = server.info()?;
|
|
151
|
+
///
|
|
152
|
+
/// assert_eq!(server_info.end, PipeEnd::Server);
|
|
153
|
+
/// assert_eq!(server_info.mode, PipeMode::Message);
|
|
154
|
+
/// assert_eq!(server_info.max_instances, 5);
|
|
155
|
+
/// # Ok(()) }
|
|
156
|
+
/// ```
|
|
157
|
+
pub fn info(&self) -> io::Result<PipeInfo> {
|
|
158
|
+
// Safety: we're ensuring the lifetime of the named pipe.
|
|
159
|
+
unsafe { named_pipe_info(self.io.as_raw_handle()) }
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/// Enables a named pipe server process to wait for a client process to
|
|
163
|
+
/// connect to an instance of a named pipe. A client process connects by
|
|
164
|
+
/// creating a named pipe with the same name.
|
|
165
|
+
///
|
|
166
|
+
/// This corresponds to the [`ConnectNamedPipe`] system call.
|
|
167
|
+
///
|
|
168
|
+
/// # Cancel safety
|
|
169
|
+
///
|
|
170
|
+
/// This method is cancellation safe in the sense that if it is used as the
|
|
171
|
+
/// event in a [`select!`](crate::select) statement and some other branch
|
|
172
|
+
/// completes first, then no connection events have been lost.
|
|
173
|
+
///
|
|
174
|
+
/// [`ConnectNamedPipe`]: https://docs.microsoft.com/en-us/windows/win32/api/namedpipeapi/nf-namedpipeapi-connectnamedpipe
|
|
175
|
+
///
|
|
176
|
+
/// # Example
|
|
177
|
+
///
|
|
178
|
+
/// ```no_run
|
|
179
|
+
/// use tokio::net::windows::named_pipe::ServerOptions;
|
|
180
|
+
///
|
|
181
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\mynamedpipe";
|
|
182
|
+
///
|
|
183
|
+
/// # #[tokio::main] async fn main() -> std::io::Result<()> {
|
|
184
|
+
/// let pipe = ServerOptions::new().create(PIPE_NAME)?;
|
|
185
|
+
///
|
|
186
|
+
/// // Wait for a client to connect.
|
|
187
|
+
/// pipe.connect().await?;
|
|
188
|
+
///
|
|
189
|
+
/// // Use the connected client...
|
|
190
|
+
/// # Ok(()) }
|
|
191
|
+
/// ```
|
|
192
|
+
pub async fn connect(&self) -> io::Result<()> {
|
|
193
|
+
match self.io.connect() {
|
|
194
|
+
Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
195
|
+
self.io
|
|
196
|
+
.registration()
|
|
197
|
+
.async_io(Interest::WRITABLE, || self.io.connect())
|
|
198
|
+
.await
|
|
199
|
+
}
|
|
200
|
+
x => x,
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/// Disconnects the server end of a named pipe instance from a client
|
|
205
|
+
/// process.
|
|
206
|
+
///
|
|
207
|
+
/// ```
|
|
208
|
+
/// use tokio::io::AsyncWriteExt;
|
|
209
|
+
/// use tokio::net::windows::named_pipe::{ClientOptions, ServerOptions};
|
|
210
|
+
/// use windows_sys::Win32::Foundation::ERROR_PIPE_NOT_CONNECTED;
|
|
211
|
+
///
|
|
212
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-disconnect";
|
|
213
|
+
///
|
|
214
|
+
/// # #[tokio::main] async fn main() -> std::io::Result<()> {
|
|
215
|
+
/// let server = ServerOptions::new()
|
|
216
|
+
/// .create(PIPE_NAME)?;
|
|
217
|
+
///
|
|
218
|
+
/// let mut client = ClientOptions::new()
|
|
219
|
+
/// .open(PIPE_NAME)?;
|
|
220
|
+
///
|
|
221
|
+
/// // Wait for a client to become connected.
|
|
222
|
+
/// server.connect().await?;
|
|
223
|
+
///
|
|
224
|
+
/// // Forcibly disconnect the client.
|
|
225
|
+
/// server.disconnect()?;
|
|
226
|
+
///
|
|
227
|
+
/// // Write fails with an OS-specific error after client has been
|
|
228
|
+
/// // disconnected.
|
|
229
|
+
/// let e = client.write(b"ping").await.unwrap_err();
|
|
230
|
+
/// assert_eq!(e.raw_os_error(), Some(ERROR_PIPE_NOT_CONNECTED as i32));
|
|
231
|
+
/// # Ok(()) }
|
|
232
|
+
/// ```
|
|
233
|
+
pub fn disconnect(&self) -> io::Result<()> {
|
|
234
|
+
self.io.disconnect()
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/// Waits for any of the requested ready states.
|
|
238
|
+
///
|
|
239
|
+
/// This function is usually paired with `try_read()` or `try_write()`. It
|
|
240
|
+
/// can be used to concurrently read / write to the same pipe on a single
|
|
241
|
+
/// task without splitting the pipe.
|
|
242
|
+
///
|
|
243
|
+
/// The function may complete without the pipe being ready. This is a
|
|
244
|
+
/// false-positive and attempting an operation will return with
|
|
245
|
+
/// `io::ErrorKind::WouldBlock`. The function can also return with an empty
|
|
246
|
+
/// [`Ready`] set, so you should always check the returned value and possibly
|
|
247
|
+
/// wait again if the requested states are not set.
|
|
248
|
+
///
|
|
249
|
+
/// # Examples
|
|
250
|
+
///
|
|
251
|
+
/// Concurrently read and write to the pipe on the same task without
|
|
252
|
+
/// splitting.
|
|
253
|
+
///
|
|
254
|
+
/// ```no_run
|
|
255
|
+
/// use tokio::io::Interest;
|
|
256
|
+
/// use tokio::net::windows::named_pipe;
|
|
257
|
+
/// use std::error::Error;
|
|
258
|
+
/// use std::io;
|
|
259
|
+
///
|
|
260
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-server-ready";
|
|
261
|
+
///
|
|
262
|
+
/// #[tokio::main]
|
|
263
|
+
/// async fn main() -> Result<(), Box<dyn Error>> {
|
|
264
|
+
/// let server = named_pipe::ServerOptions::new()
|
|
265
|
+
/// .create(PIPE_NAME)?;
|
|
266
|
+
///
|
|
267
|
+
/// loop {
|
|
268
|
+
/// let ready = server.ready(Interest::READABLE | Interest::WRITABLE).await?;
|
|
269
|
+
///
|
|
270
|
+
/// if ready.is_readable() {
|
|
271
|
+
/// let mut data = vec![0; 1024];
|
|
272
|
+
/// // Try to read data, this may still fail with `WouldBlock`
|
|
273
|
+
/// // if the readiness event is a false positive.
|
|
274
|
+
/// match server.try_read(&mut data) {
|
|
275
|
+
/// Ok(n) => {
|
|
276
|
+
/// println!("read {} bytes", n);
|
|
277
|
+
/// }
|
|
278
|
+
/// Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
279
|
+
/// continue;
|
|
280
|
+
/// }
|
|
281
|
+
/// Err(e) => {
|
|
282
|
+
/// return Err(e.into());
|
|
283
|
+
/// }
|
|
284
|
+
/// }
|
|
285
|
+
/// }
|
|
286
|
+
///
|
|
287
|
+
/// if ready.is_writable() {
|
|
288
|
+
/// // Try to write data, this may still fail with `WouldBlock`
|
|
289
|
+
/// // if the readiness event is a false positive.
|
|
290
|
+
/// match server.try_write(b"hello world") {
|
|
291
|
+
/// Ok(n) => {
|
|
292
|
+
/// println!("write {} bytes", n);
|
|
293
|
+
/// }
|
|
294
|
+
/// Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
295
|
+
/// continue;
|
|
296
|
+
/// }
|
|
297
|
+
/// Err(e) => {
|
|
298
|
+
/// return Err(e.into());
|
|
299
|
+
/// }
|
|
300
|
+
/// }
|
|
301
|
+
/// }
|
|
302
|
+
/// }
|
|
303
|
+
/// }
|
|
304
|
+
/// ```
|
|
305
|
+
pub async fn ready(&self, interest: Interest) -> io::Result<Ready> {
|
|
306
|
+
let event = self.io.registration().readiness(interest).await?;
|
|
307
|
+
Ok(event.ready)
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/// Waits for the pipe to become readable.
|
|
311
|
+
///
|
|
312
|
+
/// This function is equivalent to `ready(Interest::READABLE)` and is usually
|
|
313
|
+
/// paired with `try_read()`.
|
|
314
|
+
///
|
|
315
|
+
/// # Examples
|
|
316
|
+
///
|
|
317
|
+
/// ```no_run
|
|
318
|
+
/// use tokio::net::windows::named_pipe;
|
|
319
|
+
/// use std::error::Error;
|
|
320
|
+
/// use std::io;
|
|
321
|
+
///
|
|
322
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-server-readable";
|
|
323
|
+
///
|
|
324
|
+
/// #[tokio::main]
|
|
325
|
+
/// async fn main() -> Result<(), Box<dyn Error>> {
|
|
326
|
+
/// let server = named_pipe::ServerOptions::new()
|
|
327
|
+
/// .create(PIPE_NAME)?;
|
|
328
|
+
///
|
|
329
|
+
/// let mut msg = vec![0; 1024];
|
|
330
|
+
///
|
|
331
|
+
/// loop {
|
|
332
|
+
/// // Wait for the pipe to be readable
|
|
333
|
+
/// server.readable().await?;
|
|
334
|
+
///
|
|
335
|
+
/// // Try to read data, this may still fail with `WouldBlock`
|
|
336
|
+
/// // if the readiness event is a false positive.
|
|
337
|
+
/// match server.try_read(&mut msg) {
|
|
338
|
+
/// Ok(n) => {
|
|
339
|
+
/// msg.truncate(n);
|
|
340
|
+
/// break;
|
|
341
|
+
/// }
|
|
342
|
+
/// Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
343
|
+
/// continue;
|
|
344
|
+
/// }
|
|
345
|
+
/// Err(e) => {
|
|
346
|
+
/// return Err(e.into());
|
|
347
|
+
/// }
|
|
348
|
+
/// }
|
|
349
|
+
/// }
|
|
350
|
+
///
|
|
351
|
+
/// println!("GOT = {:?}", msg);
|
|
352
|
+
/// Ok(())
|
|
353
|
+
/// }
|
|
354
|
+
/// ```
|
|
355
|
+
pub async fn readable(&self) -> io::Result<()> {
|
|
356
|
+
self.ready(Interest::READABLE).await?;
|
|
357
|
+
Ok(())
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/// Polls for read readiness.
|
|
361
|
+
///
|
|
362
|
+
/// If the pipe is not currently ready for reading, this method will
|
|
363
|
+
/// store a clone of the `Waker` from the provided `Context`. When the pipe
|
|
364
|
+
/// becomes ready for reading, `Waker::wake` will be called on the waker.
|
|
365
|
+
///
|
|
366
|
+
/// Note that on multiple calls to `poll_read_ready` or `poll_read`, only
|
|
367
|
+
/// the `Waker` from the `Context` passed to the most recent call is
|
|
368
|
+
/// scheduled to receive a wakeup. (However, `poll_write_ready` retains a
|
|
369
|
+
/// second, independent waker.)
|
|
370
|
+
///
|
|
371
|
+
/// This function is intended for cases where creating and pinning a future
|
|
372
|
+
/// via [`readable`] is not feasible. Where possible, using [`readable`] is
|
|
373
|
+
/// preferred, as this supports polling from multiple tasks at once.
|
|
374
|
+
///
|
|
375
|
+
/// # Return value
|
|
376
|
+
///
|
|
377
|
+
/// The function returns:
|
|
378
|
+
///
|
|
379
|
+
/// * `Poll::Pending` if the pipe is not ready for reading.
|
|
380
|
+
/// * `Poll::Ready(Ok(()))` if the pipe is ready for reading.
|
|
381
|
+
/// * `Poll::Ready(Err(e))` if an error is encountered.
|
|
382
|
+
///
|
|
383
|
+
/// # Errors
|
|
384
|
+
///
|
|
385
|
+
/// This function may encounter any standard I/O error except `WouldBlock`.
|
|
386
|
+
///
|
|
387
|
+
/// [`readable`]: method@Self::readable
|
|
388
|
+
pub fn poll_read_ready(&self, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
|
|
389
|
+
self.io.registration().poll_read_ready(cx).map_ok(|_| ())
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/// Tries to read data from the pipe into the provided buffer, returning how
|
|
393
|
+
/// many bytes were read.
|
|
394
|
+
///
|
|
395
|
+
/// Receives any pending data from the pipe but does not wait for new data
|
|
396
|
+
/// to arrive. On success, returns the number of bytes read. Because
|
|
397
|
+
/// `try_read()` is non-blocking, the buffer does not have to be stored by
|
|
398
|
+
/// the async task and can exist entirely on the stack.
|
|
399
|
+
///
|
|
400
|
+
/// Usually, [`readable()`] or [`ready()`] is used with this function.
|
|
401
|
+
///
|
|
402
|
+
/// [`readable()`]: NamedPipeServer::readable()
|
|
403
|
+
/// [`ready()`]: NamedPipeServer::ready()
|
|
404
|
+
///
|
|
405
|
+
/// # Return
|
|
406
|
+
///
|
|
407
|
+
/// If data is successfully read, `Ok(n)` is returned, where `n` is the
|
|
408
|
+
/// number of bytes read. If `n` is `0`, then it can indicate one of two scenarios:
|
|
409
|
+
///
|
|
410
|
+
/// 1. The pipe's read half is closed and will no longer yield data.
|
|
411
|
+
/// 2. The specified buffer was 0 bytes in length.
|
|
412
|
+
///
|
|
413
|
+
/// If the pipe is not ready to read data,
|
|
414
|
+
/// `Err(io::ErrorKind::WouldBlock)` is returned.
|
|
415
|
+
///
|
|
416
|
+
/// # Examples
|
|
417
|
+
///
|
|
418
|
+
/// ```no_run
|
|
419
|
+
/// use tokio::net::windows::named_pipe;
|
|
420
|
+
/// use std::error::Error;
|
|
421
|
+
/// use std::io;
|
|
422
|
+
///
|
|
423
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-server-try-read";
|
|
424
|
+
///
|
|
425
|
+
/// #[tokio::main]
|
|
426
|
+
/// async fn main() -> Result<(), Box<dyn Error>> {
|
|
427
|
+
/// let server = named_pipe::ServerOptions::new()
|
|
428
|
+
/// .create(PIPE_NAME)?;
|
|
429
|
+
///
|
|
430
|
+
/// loop {
|
|
431
|
+
/// // Wait for the pipe to be readable
|
|
432
|
+
/// server.readable().await?;
|
|
433
|
+
///
|
|
434
|
+
/// // Creating the buffer **after** the `await` prevents it from
|
|
435
|
+
/// // being stored in the async task.
|
|
436
|
+
/// let mut buf = [0; 4096];
|
|
437
|
+
///
|
|
438
|
+
/// // Try to read data, this may still fail with `WouldBlock`
|
|
439
|
+
/// // if the readiness event is a false positive.
|
|
440
|
+
/// match server.try_read(&mut buf) {
|
|
441
|
+
/// Ok(0) => break,
|
|
442
|
+
/// Ok(n) => {
|
|
443
|
+
/// println!("read {} bytes", n);
|
|
444
|
+
/// }
|
|
445
|
+
/// Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
446
|
+
/// continue;
|
|
447
|
+
/// }
|
|
448
|
+
/// Err(e) => {
|
|
449
|
+
/// return Err(e.into());
|
|
450
|
+
/// }
|
|
451
|
+
/// }
|
|
452
|
+
/// }
|
|
453
|
+
///
|
|
454
|
+
/// Ok(())
|
|
455
|
+
/// }
|
|
456
|
+
/// ```
|
|
457
|
+
pub fn try_read(&self, buf: &mut [u8]) -> io::Result<usize> {
|
|
458
|
+
self.io
|
|
459
|
+
.registration()
|
|
460
|
+
.try_io(Interest::READABLE, || (&*self.io).read(buf))
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/// Tries to read data from the pipe into the provided buffers, returning
|
|
464
|
+
/// how many bytes were read.
|
|
465
|
+
///
|
|
466
|
+
/// Data is copied to fill each buffer in order, with the final buffer
|
|
467
|
+
/// written to possibly being only partially filled. This method behaves
|
|
468
|
+
/// equivalently to a single call to [`try_read()`] with concatenated
|
|
469
|
+
/// buffers.
|
|
470
|
+
///
|
|
471
|
+
/// Receives any pending data from the pipe but does not wait for new data
|
|
472
|
+
/// to arrive. On success, returns the number of bytes read. Because
|
|
473
|
+
/// `try_read_vectored()` is non-blocking, the buffer does not have to be
|
|
474
|
+
/// stored by the async task and can exist entirely on the stack.
|
|
475
|
+
///
|
|
476
|
+
/// Usually, [`readable()`] or [`ready()`] is used with this function.
|
|
477
|
+
///
|
|
478
|
+
/// [`try_read()`]: NamedPipeServer::try_read()
|
|
479
|
+
/// [`readable()`]: NamedPipeServer::readable()
|
|
480
|
+
/// [`ready()`]: NamedPipeServer::ready()
|
|
481
|
+
///
|
|
482
|
+
/// # Return
|
|
483
|
+
///
|
|
484
|
+
/// If data is successfully read, `Ok(n)` is returned, where `n` is the
|
|
485
|
+
/// number of bytes read. `Ok(0)` indicates the pipe's read half is closed
|
|
486
|
+
/// and will no longer yield data. If the pipe is not ready to read data
|
|
487
|
+
/// `Err(io::ErrorKind::WouldBlock)` is returned.
|
|
488
|
+
///
|
|
489
|
+
/// # Examples
|
|
490
|
+
///
|
|
491
|
+
/// ```no_run
|
|
492
|
+
/// use tokio::net::windows::named_pipe;
|
|
493
|
+
/// use std::error::Error;
|
|
494
|
+
/// use std::io::{self, IoSliceMut};
|
|
495
|
+
///
|
|
496
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-server-try-read-vectored";
|
|
497
|
+
///
|
|
498
|
+
/// #[tokio::main]
|
|
499
|
+
/// async fn main() -> Result<(), Box<dyn Error>> {
|
|
500
|
+
/// let server = named_pipe::ServerOptions::new()
|
|
501
|
+
/// .create(PIPE_NAME)?;
|
|
502
|
+
///
|
|
503
|
+
/// loop {
|
|
504
|
+
/// // Wait for the pipe to be readable
|
|
505
|
+
/// server.readable().await?;
|
|
506
|
+
///
|
|
507
|
+
/// // Creating the buffer **after** the `await` prevents it from
|
|
508
|
+
/// // being stored in the async task.
|
|
509
|
+
/// let mut buf_a = [0; 512];
|
|
510
|
+
/// let mut buf_b = [0; 1024];
|
|
511
|
+
/// let mut bufs = [
|
|
512
|
+
/// IoSliceMut::new(&mut buf_a),
|
|
513
|
+
/// IoSliceMut::new(&mut buf_b),
|
|
514
|
+
/// ];
|
|
515
|
+
///
|
|
516
|
+
/// // Try to read data, this may still fail with `WouldBlock`
|
|
517
|
+
/// // if the readiness event is a false positive.
|
|
518
|
+
/// match server.try_read_vectored(&mut bufs) {
|
|
519
|
+
/// Ok(0) => break,
|
|
520
|
+
/// Ok(n) => {
|
|
521
|
+
/// println!("read {} bytes", n);
|
|
522
|
+
/// }
|
|
523
|
+
/// Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
524
|
+
/// continue;
|
|
525
|
+
/// }
|
|
526
|
+
/// Err(e) => {
|
|
527
|
+
/// return Err(e.into());
|
|
528
|
+
/// }
|
|
529
|
+
/// }
|
|
530
|
+
/// }
|
|
531
|
+
///
|
|
532
|
+
/// Ok(())
|
|
533
|
+
/// }
|
|
534
|
+
/// ```
|
|
535
|
+
pub fn try_read_vectored(&self, bufs: &mut [io::IoSliceMut<'_>]) -> io::Result<usize> {
|
|
536
|
+
self.io
|
|
537
|
+
.registration()
|
|
538
|
+
.try_io(Interest::READABLE, || (&*self.io).read_vectored(bufs))
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
cfg_io_util! {
|
|
542
|
+
/// Tries to read data from the stream into the provided buffer, advancing the
|
|
543
|
+
/// buffer's internal cursor, returning how many bytes were read.
|
|
544
|
+
///
|
|
545
|
+
/// Receives any pending data from the pipe but does not wait for new data
|
|
546
|
+
/// to arrive. On success, returns the number of bytes read. Because
|
|
547
|
+
/// `try_read_buf()` is non-blocking, the buffer does not have to be stored by
|
|
548
|
+
/// the async task and can exist entirely on the stack.
|
|
549
|
+
///
|
|
550
|
+
/// Usually, [`readable()`] or [`ready()`] is used with this function.
|
|
551
|
+
///
|
|
552
|
+
/// [`readable()`]: NamedPipeServer::readable()
|
|
553
|
+
/// [`ready()`]: NamedPipeServer::ready()
|
|
554
|
+
///
|
|
555
|
+
/// # Return
|
|
556
|
+
///
|
|
557
|
+
/// If data is successfully read, `Ok(n)` is returned, where `n` is the
|
|
558
|
+
/// number of bytes read. `Ok(0)` indicates the stream's read half is closed
|
|
559
|
+
/// and will no longer yield data. If the stream is not ready to read data
|
|
560
|
+
/// `Err(io::ErrorKind::WouldBlock)` is returned.
|
|
561
|
+
///
|
|
562
|
+
/// # Examples
|
|
563
|
+
///
|
|
564
|
+
/// ```no_run
|
|
565
|
+
/// use tokio::net::windows::named_pipe;
|
|
566
|
+
/// use std::error::Error;
|
|
567
|
+
/// use std::io;
|
|
568
|
+
///
|
|
569
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-client-readable";
|
|
570
|
+
///
|
|
571
|
+
/// #[tokio::main]
|
|
572
|
+
/// async fn main() -> Result<(), Box<dyn Error>> {
|
|
573
|
+
/// let server = named_pipe::ServerOptions::new().create(PIPE_NAME)?;
|
|
574
|
+
///
|
|
575
|
+
/// loop {
|
|
576
|
+
/// // Wait for the pipe to be readable
|
|
577
|
+
/// server.readable().await?;
|
|
578
|
+
///
|
|
579
|
+
/// let mut buf = Vec::with_capacity(4096);
|
|
580
|
+
///
|
|
581
|
+
/// // Try to read data, this may still fail with `WouldBlock`
|
|
582
|
+
/// // if the readiness event is a false positive.
|
|
583
|
+
/// match server.try_read_buf(&mut buf) {
|
|
584
|
+
/// Ok(0) => break,
|
|
585
|
+
/// Ok(n) => {
|
|
586
|
+
/// println!("read {} bytes", n);
|
|
587
|
+
/// }
|
|
588
|
+
/// Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
589
|
+
/// continue;
|
|
590
|
+
/// }
|
|
591
|
+
/// Err(e) => {
|
|
592
|
+
/// return Err(e.into());
|
|
593
|
+
/// }
|
|
594
|
+
/// }
|
|
595
|
+
/// }
|
|
596
|
+
///
|
|
597
|
+
/// Ok(())
|
|
598
|
+
/// }
|
|
599
|
+
/// ```
|
|
600
|
+
pub fn try_read_buf<B: BufMut>(&self, buf: &mut B) -> io::Result<usize> {
|
|
601
|
+
self.io.registration().try_io(Interest::READABLE, || {
|
|
602
|
+
use std::io::Read;
|
|
603
|
+
|
|
604
|
+
let dst = buf.chunk_mut();
|
|
605
|
+
let dst =
|
|
606
|
+
unsafe { &mut *(dst as *mut _ as *mut [std::mem::MaybeUninit<u8>] as *mut [u8]) };
|
|
607
|
+
|
|
608
|
+
// Safety: We trust `NamedPipeServer::read` to have filled up `n` bytes in the
|
|
609
|
+
// buffer.
|
|
610
|
+
let n = (&*self.io).read(dst)?;
|
|
611
|
+
|
|
612
|
+
unsafe {
|
|
613
|
+
buf.advance_mut(n);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
Ok(n)
|
|
617
|
+
})
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
/// Waits for the pipe to become writable.
|
|
622
|
+
///
|
|
623
|
+
/// This function is equivalent to `ready(Interest::WRITABLE)` and is usually
|
|
624
|
+
/// paired with `try_write()`.
|
|
625
|
+
///
|
|
626
|
+
/// # Examples
|
|
627
|
+
///
|
|
628
|
+
/// ```no_run
|
|
629
|
+
/// use tokio::net::windows::named_pipe;
|
|
630
|
+
/// use std::error::Error;
|
|
631
|
+
/// use std::io;
|
|
632
|
+
///
|
|
633
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-server-writable";
|
|
634
|
+
///
|
|
635
|
+
/// #[tokio::main]
|
|
636
|
+
/// async fn main() -> Result<(), Box<dyn Error>> {
|
|
637
|
+
/// let server = named_pipe::ServerOptions::new()
|
|
638
|
+
/// .create(PIPE_NAME)?;
|
|
639
|
+
///
|
|
640
|
+
/// loop {
|
|
641
|
+
/// // Wait for the pipe to be writable
|
|
642
|
+
/// server.writable().await?;
|
|
643
|
+
///
|
|
644
|
+
/// // Try to write data, this may still fail with `WouldBlock`
|
|
645
|
+
/// // if the readiness event is a false positive.
|
|
646
|
+
/// match server.try_write(b"hello world") {
|
|
647
|
+
/// Ok(n) => {
|
|
648
|
+
/// break;
|
|
649
|
+
/// }
|
|
650
|
+
/// Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
651
|
+
/// continue;
|
|
652
|
+
/// }
|
|
653
|
+
/// Err(e) => {
|
|
654
|
+
/// return Err(e.into());
|
|
655
|
+
/// }
|
|
656
|
+
/// }
|
|
657
|
+
/// }
|
|
658
|
+
///
|
|
659
|
+
/// Ok(())
|
|
660
|
+
/// }
|
|
661
|
+
/// ```
|
|
662
|
+
pub async fn writable(&self) -> io::Result<()> {
|
|
663
|
+
self.ready(Interest::WRITABLE).await?;
|
|
664
|
+
Ok(())
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
/// Polls for write readiness.
|
|
668
|
+
///
|
|
669
|
+
/// If the pipe is not currently ready for writing, this method will
|
|
670
|
+
/// store a clone of the `Waker` from the provided `Context`. When the pipe
|
|
671
|
+
/// becomes ready for writing, `Waker::wake` will be called on the waker.
|
|
672
|
+
///
|
|
673
|
+
/// Note that on multiple calls to `poll_write_ready` or `poll_write`, only
|
|
674
|
+
/// the `Waker` from the `Context` passed to the most recent call is
|
|
675
|
+
/// scheduled to receive a wakeup. (However, `poll_read_ready` retains a
|
|
676
|
+
/// second, independent waker.)
|
|
677
|
+
///
|
|
678
|
+
/// This function is intended for cases where creating and pinning a future
|
|
679
|
+
/// via [`writable`] is not feasible. Where possible, using [`writable`] is
|
|
680
|
+
/// preferred, as this supports polling from multiple tasks at once.
|
|
681
|
+
///
|
|
682
|
+
/// # Return value
|
|
683
|
+
///
|
|
684
|
+
/// The function returns:
|
|
685
|
+
///
|
|
686
|
+
/// * `Poll::Pending` if the pipe is not ready for writing.
|
|
687
|
+
/// * `Poll::Ready(Ok(()))` if the pipe is ready for writing.
|
|
688
|
+
/// * `Poll::Ready(Err(e))` if an error is encountered.
|
|
689
|
+
///
|
|
690
|
+
/// # Errors
|
|
691
|
+
///
|
|
692
|
+
/// This function may encounter any standard I/O error except `WouldBlock`.
|
|
693
|
+
///
|
|
694
|
+
/// [`writable`]: method@Self::writable
|
|
695
|
+
pub fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
|
|
696
|
+
self.io.registration().poll_write_ready(cx).map_ok(|_| ())
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/// Tries to write a buffer to the pipe, returning how many bytes were
|
|
700
|
+
/// written.
|
|
701
|
+
///
|
|
702
|
+
/// The function will attempt to write the entire contents of `buf`, but
|
|
703
|
+
/// only part of the buffer may be written.
|
|
704
|
+
///
|
|
705
|
+
/// This function is usually paired with `writable()`.
|
|
706
|
+
///
|
|
707
|
+
/// # Return
|
|
708
|
+
///
|
|
709
|
+
/// If data is successfully written, `Ok(n)` is returned, where `n` is the
|
|
710
|
+
/// number of bytes written. If the pipe is not ready to write data,
|
|
711
|
+
/// `Err(io::ErrorKind::WouldBlock)` is returned.
|
|
712
|
+
///
|
|
713
|
+
/// # Examples
|
|
714
|
+
///
|
|
715
|
+
/// ```no_run
|
|
716
|
+
/// use tokio::net::windows::named_pipe;
|
|
717
|
+
/// use std::error::Error;
|
|
718
|
+
/// use std::io;
|
|
719
|
+
///
|
|
720
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-server-try-write";
|
|
721
|
+
///
|
|
722
|
+
/// #[tokio::main]
|
|
723
|
+
/// async fn main() -> Result<(), Box<dyn Error>> {
|
|
724
|
+
/// let server = named_pipe::ServerOptions::new()
|
|
725
|
+
/// .create(PIPE_NAME)?;
|
|
726
|
+
///
|
|
727
|
+
/// loop {
|
|
728
|
+
/// // Wait for the pipe to be writable
|
|
729
|
+
/// server.writable().await?;
|
|
730
|
+
///
|
|
731
|
+
/// // Try to write data, this may still fail with `WouldBlock`
|
|
732
|
+
/// // if the readiness event is a false positive.
|
|
733
|
+
/// match server.try_write(b"hello world") {
|
|
734
|
+
/// Ok(n) => {
|
|
735
|
+
/// break;
|
|
736
|
+
/// }
|
|
737
|
+
/// Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
738
|
+
/// continue;
|
|
739
|
+
/// }
|
|
740
|
+
/// Err(e) => {
|
|
741
|
+
/// return Err(e.into());
|
|
742
|
+
/// }
|
|
743
|
+
/// }
|
|
744
|
+
/// }
|
|
745
|
+
///
|
|
746
|
+
/// Ok(())
|
|
747
|
+
/// }
|
|
748
|
+
/// ```
|
|
749
|
+
pub fn try_write(&self, buf: &[u8]) -> io::Result<usize> {
|
|
750
|
+
self.io
|
|
751
|
+
.registration()
|
|
752
|
+
.try_io(Interest::WRITABLE, || (&*self.io).write(buf))
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
/// Tries to write several buffers to the pipe, returning how many bytes
|
|
756
|
+
/// were written.
|
|
757
|
+
///
|
|
758
|
+
/// Data is written from each buffer in order, with the final buffer read
|
|
759
|
+
/// from possible being only partially consumed. This method behaves
|
|
760
|
+
/// equivalently to a single call to [`try_write()`] with concatenated
|
|
761
|
+
/// buffers.
|
|
762
|
+
///
|
|
763
|
+
/// This function is usually paired with `writable()`.
|
|
764
|
+
///
|
|
765
|
+
/// [`try_write()`]: NamedPipeServer::try_write()
|
|
766
|
+
///
|
|
767
|
+
/// # Return
|
|
768
|
+
///
|
|
769
|
+
/// If data is successfully written, `Ok(n)` is returned, where `n` is the
|
|
770
|
+
/// number of bytes written. If the pipe is not ready to write data,
|
|
771
|
+
/// `Err(io::ErrorKind::WouldBlock)` is returned.
|
|
772
|
+
///
|
|
773
|
+
/// # Examples
|
|
774
|
+
///
|
|
775
|
+
/// ```no_run
|
|
776
|
+
/// use tokio::net::windows::named_pipe;
|
|
777
|
+
/// use std::error::Error;
|
|
778
|
+
/// use std::io;
|
|
779
|
+
///
|
|
780
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-server-try-write-vectored";
|
|
781
|
+
///
|
|
782
|
+
/// #[tokio::main]
|
|
783
|
+
/// async fn main() -> Result<(), Box<dyn Error>> {
|
|
784
|
+
/// let server = named_pipe::ServerOptions::new()
|
|
785
|
+
/// .create(PIPE_NAME)?;
|
|
786
|
+
///
|
|
787
|
+
/// let bufs = [io::IoSlice::new(b"hello "), io::IoSlice::new(b"world")];
|
|
788
|
+
///
|
|
789
|
+
/// loop {
|
|
790
|
+
/// // Wait for the pipe to be writable
|
|
791
|
+
/// server.writable().await?;
|
|
792
|
+
///
|
|
793
|
+
/// // Try to write data, this may still fail with `WouldBlock`
|
|
794
|
+
/// // if the readiness event is a false positive.
|
|
795
|
+
/// match server.try_write_vectored(&bufs) {
|
|
796
|
+
/// Ok(n) => {
|
|
797
|
+
/// break;
|
|
798
|
+
/// }
|
|
799
|
+
/// Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
800
|
+
/// continue;
|
|
801
|
+
/// }
|
|
802
|
+
/// Err(e) => {
|
|
803
|
+
/// return Err(e.into());
|
|
804
|
+
/// }
|
|
805
|
+
/// }
|
|
806
|
+
/// }
|
|
807
|
+
///
|
|
808
|
+
/// Ok(())
|
|
809
|
+
/// }
|
|
810
|
+
/// ```
|
|
811
|
+
pub fn try_write_vectored(&self, buf: &[io::IoSlice<'_>]) -> io::Result<usize> {
|
|
812
|
+
self.io
|
|
813
|
+
.registration()
|
|
814
|
+
.try_io(Interest::WRITABLE, || (&*self.io).write_vectored(buf))
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/// Tries to read or write from the pipe using a user-provided IO operation.
|
|
818
|
+
///
|
|
819
|
+
/// If the pipe is ready, the provided closure is called. The closure
|
|
820
|
+
/// should attempt to perform IO operation from the pipe by manually
|
|
821
|
+
/// calling the appropriate syscall. If the operation fails because the
|
|
822
|
+
/// pipe is not actually ready, then the closure should return a
|
|
823
|
+
/// `WouldBlock` error and the readiness flag is cleared. The return value
|
|
824
|
+
/// of the closure is then returned by `try_io`.
|
|
825
|
+
///
|
|
826
|
+
/// If the pipe is not ready, then the closure is not called
|
|
827
|
+
/// and a `WouldBlock` error is returned.
|
|
828
|
+
///
|
|
829
|
+
/// The closure should only return a `WouldBlock` error if it has performed
|
|
830
|
+
/// an IO operation on the pipe that failed due to the pipe not being
|
|
831
|
+
/// ready. Returning a `WouldBlock` error in any other situation will
|
|
832
|
+
/// incorrectly clear the readiness flag, which can cause the pipe to
|
|
833
|
+
/// behave incorrectly.
|
|
834
|
+
///
|
|
835
|
+
/// The closure should not perform the IO operation using any of the
|
|
836
|
+
/// methods defined on the Tokio `NamedPipeServer` type, as this will mess with
|
|
837
|
+
/// the readiness flag and can cause the pipe to behave incorrectly.
|
|
838
|
+
///
|
|
839
|
+
/// This method is not intended to be used with combined interests.
|
|
840
|
+
/// The closure should perform only one type of IO operation, so it should not
|
|
841
|
+
/// require more than one ready state. This method may panic or sleep forever
|
|
842
|
+
/// if it is called with a combined interest.
|
|
843
|
+
///
|
|
844
|
+
/// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function.
|
|
845
|
+
///
|
|
846
|
+
/// [`readable()`]: NamedPipeServer::readable()
|
|
847
|
+
/// [`writable()`]: NamedPipeServer::writable()
|
|
848
|
+
/// [`ready()`]: NamedPipeServer::ready()
|
|
849
|
+
pub fn try_io<R>(
|
|
850
|
+
&self,
|
|
851
|
+
interest: Interest,
|
|
852
|
+
f: impl FnOnce() -> io::Result<R>,
|
|
853
|
+
) -> io::Result<R> {
|
|
854
|
+
self.io.registration().try_io(interest, f)
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
/// Reads or writes from the pipe using a user-provided IO operation.
|
|
858
|
+
///
|
|
859
|
+
/// The readiness of the pipe is awaited and when the pipe is ready,
|
|
860
|
+
/// the provided closure is called. The closure should attempt to perform
|
|
861
|
+
/// IO operation on the pipe by manually calling the appropriate syscall.
|
|
862
|
+
/// If the operation fails because the pipe is not actually ready,
|
|
863
|
+
/// then the closure should return a `WouldBlock` error. In such case the
|
|
864
|
+
/// readiness flag is cleared and the pipe readiness is awaited again.
|
|
865
|
+
/// This loop is repeated until the closure returns an `Ok` or an error
|
|
866
|
+
/// other than `WouldBlock`.
|
|
867
|
+
///
|
|
868
|
+
/// The closure should only return a `WouldBlock` error if it has performed
|
|
869
|
+
/// an IO operation on the pipe that failed due to the pipe not being
|
|
870
|
+
/// ready. Returning a `WouldBlock` error in any other situation will
|
|
871
|
+
/// incorrectly clear the readiness flag, which can cause the pipe to
|
|
872
|
+
/// behave incorrectly.
|
|
873
|
+
///
|
|
874
|
+
/// The closure should not perform the IO operation using any of the methods
|
|
875
|
+
/// defined on the Tokio `NamedPipeServer` type, as this will mess with the
|
|
876
|
+
/// readiness flag and can cause the pipe to behave incorrectly.
|
|
877
|
+
///
|
|
878
|
+
/// This method is not intended to be used with combined interests.
|
|
879
|
+
/// The closure should perform only one type of IO operation, so it should not
|
|
880
|
+
/// require more than one ready state. This method may panic or sleep forever
|
|
881
|
+
/// if it is called with a combined interest.
|
|
882
|
+
pub async fn async_io<R>(
|
|
883
|
+
&self,
|
|
884
|
+
interest: Interest,
|
|
885
|
+
f: impl FnMut() -> io::Result<R>,
|
|
886
|
+
) -> io::Result<R> {
|
|
887
|
+
self.io.registration().async_io(interest, f).await
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
impl AsyncRead for NamedPipeServer {
|
|
892
|
+
fn poll_read(
|
|
893
|
+
self: Pin<&mut Self>,
|
|
894
|
+
cx: &mut Context<'_>,
|
|
895
|
+
buf: &mut ReadBuf<'_>,
|
|
896
|
+
) -> Poll<io::Result<()>> {
|
|
897
|
+
unsafe { self.io.poll_read(cx, buf) }
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
impl AsyncWrite for NamedPipeServer {
|
|
902
|
+
fn poll_write(
|
|
903
|
+
self: Pin<&mut Self>,
|
|
904
|
+
cx: &mut Context<'_>,
|
|
905
|
+
buf: &[u8],
|
|
906
|
+
) -> Poll<io::Result<usize>> {
|
|
907
|
+
self.io.poll_write(cx, buf)
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
fn poll_write_vectored(
|
|
911
|
+
self: Pin<&mut Self>,
|
|
912
|
+
cx: &mut Context<'_>,
|
|
913
|
+
bufs: &[io::IoSlice<'_>],
|
|
914
|
+
) -> Poll<io::Result<usize>> {
|
|
915
|
+
self.io.poll_write_vectored(cx, bufs)
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<io::Result<()>> {
|
|
919
|
+
Poll::Ready(Ok(()))
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
|
|
923
|
+
self.poll_flush(cx)
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
impl AsRawHandle for NamedPipeServer {
|
|
928
|
+
fn as_raw_handle(&self) -> RawHandle {
|
|
929
|
+
self.io.as_raw_handle()
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
impl AsHandle for NamedPipeServer {
|
|
934
|
+
fn as_handle(&self) -> BorrowedHandle<'_> {
|
|
935
|
+
unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) }
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
/// A [Windows named pipe] client.
|
|
940
|
+
///
|
|
941
|
+
/// Constructed using [`ClientOptions::open`].
|
|
942
|
+
///
|
|
943
|
+
/// Connecting a client correctly involves a few steps. When connecting through
|
|
944
|
+
/// [`ClientOptions::open`], it might error indicating one of two things:
|
|
945
|
+
///
|
|
946
|
+
/// * [`std::io::ErrorKind::NotFound`] - There is no server available.
|
|
947
|
+
/// * [`ERROR_PIPE_BUSY`] - There is a server available, but it is busy. Sleep
|
|
948
|
+
/// for a while and try again.
|
|
949
|
+
///
|
|
950
|
+
/// So a correctly implemented client looks like this:
|
|
951
|
+
///
|
|
952
|
+
/// ```no_run
|
|
953
|
+
/// use std::time::Duration;
|
|
954
|
+
/// use tokio::net::windows::named_pipe::ClientOptions;
|
|
955
|
+
/// use tokio::time;
|
|
956
|
+
/// use windows_sys::Win32::Foundation::ERROR_PIPE_BUSY;
|
|
957
|
+
///
|
|
958
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\named-pipe-idiomatic-client";
|
|
959
|
+
///
|
|
960
|
+
/// # #[tokio::main] async fn main() -> std::io::Result<()> {
|
|
961
|
+
/// let client = loop {
|
|
962
|
+
/// match ClientOptions::new().open(PIPE_NAME) {
|
|
963
|
+
/// Ok(client) => break client,
|
|
964
|
+
/// Err(e) if e.raw_os_error() == Some(ERROR_PIPE_BUSY as i32) => (),
|
|
965
|
+
/// Err(e) => return Err(e),
|
|
966
|
+
/// }
|
|
967
|
+
///
|
|
968
|
+
/// time::sleep(Duration::from_millis(50)).await;
|
|
969
|
+
/// };
|
|
970
|
+
///
|
|
971
|
+
/// /* use the connected client */
|
|
972
|
+
/// # Ok(()) }
|
|
973
|
+
/// ```
|
|
974
|
+
///
|
|
975
|
+
/// [`ERROR_PIPE_BUSY`]: https://docs.rs/windows-sys/latest/windows_sys/Win32/Foundation/constant.ERROR_PIPE_BUSY.html
|
|
976
|
+
/// [Windows named pipe]: https://docs.microsoft.com/en-us/windows/win32/ipc/named-pipes
|
|
977
|
+
#[derive(Debug)]
|
|
978
|
+
pub struct NamedPipeClient {
|
|
979
|
+
io: PollEvented<mio_windows::NamedPipe>,
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
impl NamedPipeClient {
|
|
983
|
+
/// Constructs a new named pipe client from the specified raw handle.
|
|
984
|
+
///
|
|
985
|
+
/// This function will consume ownership of the handle given, passing
|
|
986
|
+
/// responsibility for closing the handle to the returned object.
|
|
987
|
+
///
|
|
988
|
+
/// This function is also unsafe as the primitives currently returned have
|
|
989
|
+
/// the contract that they are the sole owner of the file descriptor they
|
|
990
|
+
/// are wrapping. Usage of this function could accidentally allow violating
|
|
991
|
+
/// this contract which can cause memory unsafety in code that relies on it
|
|
992
|
+
/// being true.
|
|
993
|
+
///
|
|
994
|
+
/// # Errors
|
|
995
|
+
///
|
|
996
|
+
/// This errors if called outside of a [Tokio Runtime], or in a runtime that
|
|
997
|
+
/// has not [enabled I/O], or if any OS-specific I/O errors occur.
|
|
998
|
+
///
|
|
999
|
+
/// [Tokio Runtime]: crate::runtime::Runtime
|
|
1000
|
+
/// [enabled I/O]: crate::runtime::Builder::enable_io
|
|
1001
|
+
pub unsafe fn from_raw_handle(handle: RawHandle) -> io::Result<Self> {
|
|
1002
|
+
let named_pipe = unsafe { mio_windows::NamedPipe::from_raw_handle(handle) };
|
|
1003
|
+
|
|
1004
|
+
Ok(Self {
|
|
1005
|
+
io: PollEvented::new(named_pipe)?,
|
|
1006
|
+
})
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
/// Retrieves information about the named pipe the client is associated
|
|
1010
|
+
/// with.
|
|
1011
|
+
///
|
|
1012
|
+
/// ```no_run
|
|
1013
|
+
/// use tokio::net::windows::named_pipe::{ClientOptions, PipeEnd, PipeMode};
|
|
1014
|
+
///
|
|
1015
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-client-info";
|
|
1016
|
+
///
|
|
1017
|
+
/// # #[tokio::main] async fn main() -> std::io::Result<()> {
|
|
1018
|
+
/// let client = ClientOptions::new()
|
|
1019
|
+
/// .open(PIPE_NAME)?;
|
|
1020
|
+
///
|
|
1021
|
+
/// let client_info = client.info()?;
|
|
1022
|
+
///
|
|
1023
|
+
/// assert_eq!(client_info.end, PipeEnd::Client);
|
|
1024
|
+
/// assert_eq!(client_info.mode, PipeMode::Message);
|
|
1025
|
+
/// assert_eq!(client_info.max_instances, 5);
|
|
1026
|
+
/// # Ok(()) }
|
|
1027
|
+
/// ```
|
|
1028
|
+
pub fn info(&self) -> io::Result<PipeInfo> {
|
|
1029
|
+
// Safety: we're ensuring the lifetime of the named pipe.
|
|
1030
|
+
unsafe { named_pipe_info(self.io.as_raw_handle()) }
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/// Waits for any of the requested ready states.
|
|
1034
|
+
///
|
|
1035
|
+
/// This function is usually paired with `try_read()` or `try_write()`. It
|
|
1036
|
+
/// can be used to concurrently read / write to the same pipe on a single
|
|
1037
|
+
/// task without splitting the pipe.
|
|
1038
|
+
///
|
|
1039
|
+
/// The function may complete without the pipe being ready. This is a
|
|
1040
|
+
/// false-positive and attempting an operation will return with
|
|
1041
|
+
/// `io::ErrorKind::WouldBlock`. The function can also return with an empty
|
|
1042
|
+
/// [`Ready`] set, so you should always check the returned value and possibly
|
|
1043
|
+
/// wait again if the requested states are not set.
|
|
1044
|
+
///
|
|
1045
|
+
/// # Examples
|
|
1046
|
+
///
|
|
1047
|
+
/// Concurrently read and write to the pipe on the same task without
|
|
1048
|
+
/// splitting.
|
|
1049
|
+
///
|
|
1050
|
+
/// ```no_run
|
|
1051
|
+
/// use tokio::io::Interest;
|
|
1052
|
+
/// use tokio::net::windows::named_pipe;
|
|
1053
|
+
/// use std::error::Error;
|
|
1054
|
+
/// use std::io;
|
|
1055
|
+
///
|
|
1056
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-client-ready";
|
|
1057
|
+
///
|
|
1058
|
+
/// #[tokio::main]
|
|
1059
|
+
/// async fn main() -> Result<(), Box<dyn Error>> {
|
|
1060
|
+
/// let client = named_pipe::ClientOptions::new().open(PIPE_NAME)?;
|
|
1061
|
+
///
|
|
1062
|
+
/// loop {
|
|
1063
|
+
/// let ready = client.ready(Interest::READABLE | Interest::WRITABLE).await?;
|
|
1064
|
+
///
|
|
1065
|
+
/// if ready.is_readable() {
|
|
1066
|
+
/// let mut data = vec![0; 1024];
|
|
1067
|
+
/// // Try to read data, this may still fail with `WouldBlock`
|
|
1068
|
+
/// // if the readiness event is a false positive.
|
|
1069
|
+
/// match client.try_read(&mut data) {
|
|
1070
|
+
/// Ok(n) => {
|
|
1071
|
+
/// println!("read {} bytes", n);
|
|
1072
|
+
/// }
|
|
1073
|
+
/// Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
1074
|
+
/// continue;
|
|
1075
|
+
/// }
|
|
1076
|
+
/// Err(e) => {
|
|
1077
|
+
/// return Err(e.into());
|
|
1078
|
+
/// }
|
|
1079
|
+
/// }
|
|
1080
|
+
/// }
|
|
1081
|
+
///
|
|
1082
|
+
/// if ready.is_writable() {
|
|
1083
|
+
/// // Try to write data, this may still fail with `WouldBlock`
|
|
1084
|
+
/// // if the readiness event is a false positive.
|
|
1085
|
+
/// match client.try_write(b"hello world") {
|
|
1086
|
+
/// Ok(n) => {
|
|
1087
|
+
/// println!("write {} bytes", n);
|
|
1088
|
+
/// }
|
|
1089
|
+
/// Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
1090
|
+
/// continue;
|
|
1091
|
+
/// }
|
|
1092
|
+
/// Err(e) => {
|
|
1093
|
+
/// return Err(e.into());
|
|
1094
|
+
/// }
|
|
1095
|
+
/// }
|
|
1096
|
+
/// }
|
|
1097
|
+
/// }
|
|
1098
|
+
/// }
|
|
1099
|
+
/// ```
|
|
1100
|
+
pub async fn ready(&self, interest: Interest) -> io::Result<Ready> {
|
|
1101
|
+
let event = self.io.registration().readiness(interest).await?;
|
|
1102
|
+
Ok(event.ready)
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
/// Waits for the pipe to become readable.
|
|
1106
|
+
///
|
|
1107
|
+
/// This function is equivalent to `ready(Interest::READABLE)` and is usually
|
|
1108
|
+
/// paired with `try_read()`.
|
|
1109
|
+
///
|
|
1110
|
+
/// # Examples
|
|
1111
|
+
///
|
|
1112
|
+
/// ```no_run
|
|
1113
|
+
/// use tokio::net::windows::named_pipe;
|
|
1114
|
+
/// use std::error::Error;
|
|
1115
|
+
/// use std::io;
|
|
1116
|
+
///
|
|
1117
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-client-readable";
|
|
1118
|
+
///
|
|
1119
|
+
/// #[tokio::main]
|
|
1120
|
+
/// async fn main() -> Result<(), Box<dyn Error>> {
|
|
1121
|
+
/// let client = named_pipe::ClientOptions::new().open(PIPE_NAME)?;
|
|
1122
|
+
///
|
|
1123
|
+
/// let mut msg = vec![0; 1024];
|
|
1124
|
+
///
|
|
1125
|
+
/// loop {
|
|
1126
|
+
/// // Wait for the pipe to be readable
|
|
1127
|
+
/// client.readable().await?;
|
|
1128
|
+
///
|
|
1129
|
+
/// // Try to read data, this may still fail with `WouldBlock`
|
|
1130
|
+
/// // if the readiness event is a false positive.
|
|
1131
|
+
/// match client.try_read(&mut msg) {
|
|
1132
|
+
/// Ok(n) => {
|
|
1133
|
+
/// msg.truncate(n);
|
|
1134
|
+
/// break;
|
|
1135
|
+
/// }
|
|
1136
|
+
/// Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
1137
|
+
/// continue;
|
|
1138
|
+
/// }
|
|
1139
|
+
/// Err(e) => {
|
|
1140
|
+
/// return Err(e.into());
|
|
1141
|
+
/// }
|
|
1142
|
+
/// }
|
|
1143
|
+
/// }
|
|
1144
|
+
///
|
|
1145
|
+
/// println!("GOT = {:?}", msg);
|
|
1146
|
+
/// Ok(())
|
|
1147
|
+
/// }
|
|
1148
|
+
/// ```
|
|
1149
|
+
pub async fn readable(&self) -> io::Result<()> {
|
|
1150
|
+
self.ready(Interest::READABLE).await?;
|
|
1151
|
+
Ok(())
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
/// Polls for read readiness.
|
|
1155
|
+
///
|
|
1156
|
+
/// If the pipe is not currently ready for reading, this method will
|
|
1157
|
+
/// store a clone of the `Waker` from the provided `Context`. When the pipe
|
|
1158
|
+
/// becomes ready for reading, `Waker::wake` will be called on the waker.
|
|
1159
|
+
///
|
|
1160
|
+
/// Note that on multiple calls to `poll_read_ready` or `poll_read`, only
|
|
1161
|
+
/// the `Waker` from the `Context` passed to the most recent call is
|
|
1162
|
+
/// scheduled to receive a wakeup. (However, `poll_write_ready` retains a
|
|
1163
|
+
/// second, independent waker.)
|
|
1164
|
+
///
|
|
1165
|
+
/// This function is intended for cases where creating and pinning a future
|
|
1166
|
+
/// via [`readable`] is not feasible. Where possible, using [`readable`] is
|
|
1167
|
+
/// preferred, as this supports polling from multiple tasks at once.
|
|
1168
|
+
///
|
|
1169
|
+
/// # Return value
|
|
1170
|
+
///
|
|
1171
|
+
/// The function returns:
|
|
1172
|
+
///
|
|
1173
|
+
/// * `Poll::Pending` if the pipe is not ready for reading.
|
|
1174
|
+
/// * `Poll::Ready(Ok(()))` if the pipe is ready for reading.
|
|
1175
|
+
/// * `Poll::Ready(Err(e))` if an error is encountered.
|
|
1176
|
+
///
|
|
1177
|
+
/// # Errors
|
|
1178
|
+
///
|
|
1179
|
+
/// This function may encounter any standard I/O error except `WouldBlock`.
|
|
1180
|
+
///
|
|
1181
|
+
/// [`readable`]: method@Self::readable
|
|
1182
|
+
pub fn poll_read_ready(&self, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
|
|
1183
|
+
self.io.registration().poll_read_ready(cx).map_ok(|_| ())
|
|
1184
|
+
}
|
|
1185
|
+
|
|
1186
|
+
/// Tries to read data from the pipe into the provided buffer, returning how
|
|
1187
|
+
/// many bytes were read.
|
|
1188
|
+
///
|
|
1189
|
+
/// Receives any pending data from the pipe but does not wait for new data
|
|
1190
|
+
/// to arrive. On success, returns the number of bytes read. Because
|
|
1191
|
+
/// `try_read()` is non-blocking, the buffer does not have to be stored by
|
|
1192
|
+
/// the async task and can exist entirely on the stack.
|
|
1193
|
+
///
|
|
1194
|
+
/// Usually, [`readable()`] or [`ready()`] is used with this function.
|
|
1195
|
+
///
|
|
1196
|
+
/// [`readable()`]: NamedPipeClient::readable()
|
|
1197
|
+
/// [`ready()`]: NamedPipeClient::ready()
|
|
1198
|
+
///
|
|
1199
|
+
/// # Return
|
|
1200
|
+
///
|
|
1201
|
+
/// If data is successfully read, `Ok(n)` is returned, where `n` is the
|
|
1202
|
+
/// number of bytes read. If `n` is `0`, then it can indicate one of two scenarios:
|
|
1203
|
+
///
|
|
1204
|
+
/// 1. The pipe's read half is closed and will no longer yield data.
|
|
1205
|
+
/// 2. The specified buffer was 0 bytes in length.
|
|
1206
|
+
///
|
|
1207
|
+
/// If the pipe is not ready to read data,
|
|
1208
|
+
/// `Err(io::ErrorKind::WouldBlock)` is returned.
|
|
1209
|
+
///
|
|
1210
|
+
/// # Examples
|
|
1211
|
+
///
|
|
1212
|
+
/// ```no_run
|
|
1213
|
+
/// use tokio::net::windows::named_pipe;
|
|
1214
|
+
/// use std::error::Error;
|
|
1215
|
+
/// use std::io;
|
|
1216
|
+
///
|
|
1217
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-client-try-read";
|
|
1218
|
+
///
|
|
1219
|
+
/// #[tokio::main]
|
|
1220
|
+
/// async fn main() -> Result<(), Box<dyn Error>> {
|
|
1221
|
+
/// let client = named_pipe::ClientOptions::new().open(PIPE_NAME)?;
|
|
1222
|
+
///
|
|
1223
|
+
/// loop {
|
|
1224
|
+
/// // Wait for the pipe to be readable
|
|
1225
|
+
/// client.readable().await?;
|
|
1226
|
+
///
|
|
1227
|
+
/// // Creating the buffer **after** the `await` prevents it from
|
|
1228
|
+
/// // being stored in the async task.
|
|
1229
|
+
/// let mut buf = [0; 4096];
|
|
1230
|
+
///
|
|
1231
|
+
/// // Try to read data, this may still fail with `WouldBlock`
|
|
1232
|
+
/// // if the readiness event is a false positive.
|
|
1233
|
+
/// match client.try_read(&mut buf) {
|
|
1234
|
+
/// Ok(0) => break,
|
|
1235
|
+
/// Ok(n) => {
|
|
1236
|
+
/// println!("read {} bytes", n);
|
|
1237
|
+
/// }
|
|
1238
|
+
/// Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
1239
|
+
/// continue;
|
|
1240
|
+
/// }
|
|
1241
|
+
/// Err(e) => {
|
|
1242
|
+
/// return Err(e.into());
|
|
1243
|
+
/// }
|
|
1244
|
+
/// }
|
|
1245
|
+
/// }
|
|
1246
|
+
///
|
|
1247
|
+
/// Ok(())
|
|
1248
|
+
/// }
|
|
1249
|
+
/// ```
|
|
1250
|
+
pub fn try_read(&self, buf: &mut [u8]) -> io::Result<usize> {
|
|
1251
|
+
self.io
|
|
1252
|
+
.registration()
|
|
1253
|
+
.try_io(Interest::READABLE, || (&*self.io).read(buf))
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
/// Tries to read data from the pipe into the provided buffers, returning
|
|
1257
|
+
/// how many bytes were read.
|
|
1258
|
+
///
|
|
1259
|
+
/// Data is copied to fill each buffer in order, with the final buffer
|
|
1260
|
+
/// written to possibly being only partially filled. This method behaves
|
|
1261
|
+
/// equivalently to a single call to [`try_read()`] with concatenated
|
|
1262
|
+
/// buffers.
|
|
1263
|
+
///
|
|
1264
|
+
/// Receives any pending data from the pipe but does not wait for new data
|
|
1265
|
+
/// to arrive. On success, returns the number of bytes read. Because
|
|
1266
|
+
/// `try_read_vectored()` is non-blocking, the buffer does not have to be
|
|
1267
|
+
/// stored by the async task and can exist entirely on the stack.
|
|
1268
|
+
///
|
|
1269
|
+
/// Usually, [`readable()`] or [`ready()`] is used with this function.
|
|
1270
|
+
///
|
|
1271
|
+
/// [`try_read()`]: NamedPipeClient::try_read()
|
|
1272
|
+
/// [`readable()`]: NamedPipeClient::readable()
|
|
1273
|
+
/// [`ready()`]: NamedPipeClient::ready()
|
|
1274
|
+
///
|
|
1275
|
+
/// # Return
|
|
1276
|
+
///
|
|
1277
|
+
/// If data is successfully read, `Ok(n)` is returned, where `n` is the
|
|
1278
|
+
/// number of bytes read. `Ok(0)` indicates the pipe's read half is closed
|
|
1279
|
+
/// and will no longer yield data. If the pipe is not ready to read data
|
|
1280
|
+
/// `Err(io::ErrorKind::WouldBlock)` is returned.
|
|
1281
|
+
///
|
|
1282
|
+
/// # Examples
|
|
1283
|
+
///
|
|
1284
|
+
/// ```no_run
|
|
1285
|
+
/// use tokio::net::windows::named_pipe;
|
|
1286
|
+
/// use std::error::Error;
|
|
1287
|
+
/// use std::io::{self, IoSliceMut};
|
|
1288
|
+
///
|
|
1289
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-client-try-read-vectored";
|
|
1290
|
+
///
|
|
1291
|
+
/// #[tokio::main]
|
|
1292
|
+
/// async fn main() -> Result<(), Box<dyn Error>> {
|
|
1293
|
+
/// let client = named_pipe::ClientOptions::new().open(PIPE_NAME)?;
|
|
1294
|
+
///
|
|
1295
|
+
/// loop {
|
|
1296
|
+
/// // Wait for the pipe to be readable
|
|
1297
|
+
/// client.readable().await?;
|
|
1298
|
+
///
|
|
1299
|
+
/// // Creating the buffer **after** the `await` prevents it from
|
|
1300
|
+
/// // being stored in the async task.
|
|
1301
|
+
/// let mut buf_a = [0; 512];
|
|
1302
|
+
/// let mut buf_b = [0; 1024];
|
|
1303
|
+
/// let mut bufs = [
|
|
1304
|
+
/// IoSliceMut::new(&mut buf_a),
|
|
1305
|
+
/// IoSliceMut::new(&mut buf_b),
|
|
1306
|
+
/// ];
|
|
1307
|
+
///
|
|
1308
|
+
/// // Try to read data, this may still fail with `WouldBlock`
|
|
1309
|
+
/// // if the readiness event is a false positive.
|
|
1310
|
+
/// match client.try_read_vectored(&mut bufs) {
|
|
1311
|
+
/// Ok(0) => break,
|
|
1312
|
+
/// Ok(n) => {
|
|
1313
|
+
/// println!("read {} bytes", n);
|
|
1314
|
+
/// }
|
|
1315
|
+
/// Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
1316
|
+
/// continue;
|
|
1317
|
+
/// }
|
|
1318
|
+
/// Err(e) => {
|
|
1319
|
+
/// return Err(e.into());
|
|
1320
|
+
/// }
|
|
1321
|
+
/// }
|
|
1322
|
+
/// }
|
|
1323
|
+
///
|
|
1324
|
+
/// Ok(())
|
|
1325
|
+
/// }
|
|
1326
|
+
/// ```
|
|
1327
|
+
pub fn try_read_vectored(&self, bufs: &mut [io::IoSliceMut<'_>]) -> io::Result<usize> {
|
|
1328
|
+
self.io
|
|
1329
|
+
.registration()
|
|
1330
|
+
.try_io(Interest::READABLE, || (&*self.io).read_vectored(bufs))
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
cfg_io_util! {
|
|
1334
|
+
/// Tries to read data from the stream into the provided buffer, advancing the
|
|
1335
|
+
/// buffer's internal cursor, returning how many bytes were read.
|
|
1336
|
+
///
|
|
1337
|
+
/// Receives any pending data from the pipe but does not wait for new data
|
|
1338
|
+
/// to arrive. On success, returns the number of bytes read. Because
|
|
1339
|
+
/// `try_read_buf()` is non-blocking, the buffer does not have to be stored by
|
|
1340
|
+
/// the async task and can exist entirely on the stack.
|
|
1341
|
+
///
|
|
1342
|
+
/// Usually, [`readable()`] or [`ready()`] is used with this function.
|
|
1343
|
+
///
|
|
1344
|
+
/// [`readable()`]: NamedPipeClient::readable()
|
|
1345
|
+
/// [`ready()`]: NamedPipeClient::ready()
|
|
1346
|
+
///
|
|
1347
|
+
/// # Return
|
|
1348
|
+
///
|
|
1349
|
+
/// If data is successfully read, `Ok(n)` is returned, where `n` is the
|
|
1350
|
+
/// number of bytes read. `Ok(0)` indicates the stream's read half is closed
|
|
1351
|
+
/// and will no longer yield data. If the stream is not ready to read data
|
|
1352
|
+
/// `Err(io::ErrorKind::WouldBlock)` is returned.
|
|
1353
|
+
///
|
|
1354
|
+
/// # Examples
|
|
1355
|
+
///
|
|
1356
|
+
/// ```no_run
|
|
1357
|
+
/// use tokio::net::windows::named_pipe;
|
|
1358
|
+
/// use std::error::Error;
|
|
1359
|
+
/// use std::io;
|
|
1360
|
+
///
|
|
1361
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-client-readable";
|
|
1362
|
+
///
|
|
1363
|
+
/// #[tokio::main]
|
|
1364
|
+
/// async fn main() -> Result<(), Box<dyn Error>> {
|
|
1365
|
+
/// let client = named_pipe::ClientOptions::new().open(PIPE_NAME)?;
|
|
1366
|
+
///
|
|
1367
|
+
/// loop {
|
|
1368
|
+
/// // Wait for the pipe to be readable
|
|
1369
|
+
/// client.readable().await?;
|
|
1370
|
+
///
|
|
1371
|
+
/// let mut buf = Vec::with_capacity(4096);
|
|
1372
|
+
///
|
|
1373
|
+
/// // Try to read data, this may still fail with `WouldBlock`
|
|
1374
|
+
/// // if the readiness event is a false positive.
|
|
1375
|
+
/// match client.try_read_buf(&mut buf) {
|
|
1376
|
+
/// Ok(0) => break,
|
|
1377
|
+
/// Ok(n) => {
|
|
1378
|
+
/// println!("read {} bytes", n);
|
|
1379
|
+
/// }
|
|
1380
|
+
/// Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
1381
|
+
/// continue;
|
|
1382
|
+
/// }
|
|
1383
|
+
/// Err(e) => {
|
|
1384
|
+
/// return Err(e.into());
|
|
1385
|
+
/// }
|
|
1386
|
+
/// }
|
|
1387
|
+
/// }
|
|
1388
|
+
///
|
|
1389
|
+
/// Ok(())
|
|
1390
|
+
/// }
|
|
1391
|
+
/// ```
|
|
1392
|
+
pub fn try_read_buf<B: BufMut>(&self, buf: &mut B) -> io::Result<usize> {
|
|
1393
|
+
self.io.registration().try_io(Interest::READABLE, || {
|
|
1394
|
+
use std::io::Read;
|
|
1395
|
+
|
|
1396
|
+
let dst = buf.chunk_mut();
|
|
1397
|
+
let dst =
|
|
1398
|
+
unsafe { &mut *(dst as *mut _ as *mut [std::mem::MaybeUninit<u8>] as *mut [u8]) };
|
|
1399
|
+
|
|
1400
|
+
// Safety: We trust `NamedPipeClient::read` to have filled up `n` bytes in the
|
|
1401
|
+
// buffer.
|
|
1402
|
+
let n = (&*self.io).read(dst)?;
|
|
1403
|
+
|
|
1404
|
+
unsafe {
|
|
1405
|
+
buf.advance_mut(n);
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
Ok(n)
|
|
1409
|
+
})
|
|
1410
|
+
}
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
/// Waits for the pipe to become writable.
|
|
1414
|
+
///
|
|
1415
|
+
/// This function is equivalent to `ready(Interest::WRITABLE)` and is usually
|
|
1416
|
+
/// paired with `try_write()`.
|
|
1417
|
+
///
|
|
1418
|
+
/// # Examples
|
|
1419
|
+
///
|
|
1420
|
+
/// ```no_run
|
|
1421
|
+
/// use tokio::net::windows::named_pipe;
|
|
1422
|
+
/// use std::error::Error;
|
|
1423
|
+
/// use std::io;
|
|
1424
|
+
///
|
|
1425
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-client-writable";
|
|
1426
|
+
///
|
|
1427
|
+
/// #[tokio::main]
|
|
1428
|
+
/// async fn main() -> Result<(), Box<dyn Error>> {
|
|
1429
|
+
/// let client = named_pipe::ClientOptions::new().open(PIPE_NAME)?;
|
|
1430
|
+
///
|
|
1431
|
+
/// loop {
|
|
1432
|
+
/// // Wait for the pipe to be writable
|
|
1433
|
+
/// client.writable().await?;
|
|
1434
|
+
///
|
|
1435
|
+
/// // Try to write data, this may still fail with `WouldBlock`
|
|
1436
|
+
/// // if the readiness event is a false positive.
|
|
1437
|
+
/// match client.try_write(b"hello world") {
|
|
1438
|
+
/// Ok(n) => {
|
|
1439
|
+
/// break;
|
|
1440
|
+
/// }
|
|
1441
|
+
/// Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
1442
|
+
/// continue;
|
|
1443
|
+
/// }
|
|
1444
|
+
/// Err(e) => {
|
|
1445
|
+
/// return Err(e.into());
|
|
1446
|
+
/// }
|
|
1447
|
+
/// }
|
|
1448
|
+
/// }
|
|
1449
|
+
///
|
|
1450
|
+
/// Ok(())
|
|
1451
|
+
/// }
|
|
1452
|
+
/// ```
|
|
1453
|
+
pub async fn writable(&self) -> io::Result<()> {
|
|
1454
|
+
self.ready(Interest::WRITABLE).await?;
|
|
1455
|
+
Ok(())
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
/// Polls for write readiness.
|
|
1459
|
+
///
|
|
1460
|
+
/// If the pipe is not currently ready for writing, this method will
|
|
1461
|
+
/// store a clone of the `Waker` from the provided `Context`. When the pipe
|
|
1462
|
+
/// becomes ready for writing, `Waker::wake` will be called on the waker.
|
|
1463
|
+
///
|
|
1464
|
+
/// Note that on multiple calls to `poll_write_ready` or `poll_write`, only
|
|
1465
|
+
/// the `Waker` from the `Context` passed to the most recent call is
|
|
1466
|
+
/// scheduled to receive a wakeup. (However, `poll_read_ready` retains a
|
|
1467
|
+
/// second, independent waker.)
|
|
1468
|
+
///
|
|
1469
|
+
/// This function is intended for cases where creating and pinning a future
|
|
1470
|
+
/// via [`writable`] is not feasible. Where possible, using [`writable`] is
|
|
1471
|
+
/// preferred, as this supports polling from multiple tasks at once.
|
|
1472
|
+
///
|
|
1473
|
+
/// # Return value
|
|
1474
|
+
///
|
|
1475
|
+
/// The function returns:
|
|
1476
|
+
///
|
|
1477
|
+
/// * `Poll::Pending` if the pipe is not ready for writing.
|
|
1478
|
+
/// * `Poll::Ready(Ok(()))` if the pipe is ready for writing.
|
|
1479
|
+
/// * `Poll::Ready(Err(e))` if an error is encountered.
|
|
1480
|
+
///
|
|
1481
|
+
/// # Errors
|
|
1482
|
+
///
|
|
1483
|
+
/// This function may encounter any standard I/O error except `WouldBlock`.
|
|
1484
|
+
///
|
|
1485
|
+
/// [`writable`]: method@Self::writable
|
|
1486
|
+
pub fn poll_write_ready(&self, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
|
|
1487
|
+
self.io.registration().poll_write_ready(cx).map_ok(|_| ())
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
/// Tries to write a buffer to the pipe, returning how many bytes were
|
|
1491
|
+
/// written.
|
|
1492
|
+
///
|
|
1493
|
+
/// The function will attempt to write the entire contents of `buf`, but
|
|
1494
|
+
/// only part of the buffer may be written.
|
|
1495
|
+
///
|
|
1496
|
+
/// This function is usually paired with `writable()`.
|
|
1497
|
+
///
|
|
1498
|
+
/// # Return
|
|
1499
|
+
///
|
|
1500
|
+
/// If data is successfully written, `Ok(n)` is returned, where `n` is the
|
|
1501
|
+
/// number of bytes written. If the pipe is not ready to write data,
|
|
1502
|
+
/// `Err(io::ErrorKind::WouldBlock)` is returned.
|
|
1503
|
+
///
|
|
1504
|
+
/// # Examples
|
|
1505
|
+
///
|
|
1506
|
+
/// ```no_run
|
|
1507
|
+
/// use tokio::net::windows::named_pipe;
|
|
1508
|
+
/// use std::error::Error;
|
|
1509
|
+
/// use std::io;
|
|
1510
|
+
///
|
|
1511
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-client-try-write";
|
|
1512
|
+
///
|
|
1513
|
+
/// #[tokio::main]
|
|
1514
|
+
/// async fn main() -> Result<(), Box<dyn Error>> {
|
|
1515
|
+
/// let client = named_pipe::ClientOptions::new().open(PIPE_NAME)?;
|
|
1516
|
+
///
|
|
1517
|
+
/// loop {
|
|
1518
|
+
/// // Wait for the pipe to be writable
|
|
1519
|
+
/// client.writable().await?;
|
|
1520
|
+
///
|
|
1521
|
+
/// // Try to write data, this may still fail with `WouldBlock`
|
|
1522
|
+
/// // if the readiness event is a false positive.
|
|
1523
|
+
/// match client.try_write(b"hello world") {
|
|
1524
|
+
/// Ok(n) => {
|
|
1525
|
+
/// break;
|
|
1526
|
+
/// }
|
|
1527
|
+
/// Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
1528
|
+
/// continue;
|
|
1529
|
+
/// }
|
|
1530
|
+
/// Err(e) => {
|
|
1531
|
+
/// return Err(e.into());
|
|
1532
|
+
/// }
|
|
1533
|
+
/// }
|
|
1534
|
+
/// }
|
|
1535
|
+
///
|
|
1536
|
+
/// Ok(())
|
|
1537
|
+
/// }
|
|
1538
|
+
/// ```
|
|
1539
|
+
pub fn try_write(&self, buf: &[u8]) -> io::Result<usize> {
|
|
1540
|
+
self.io
|
|
1541
|
+
.registration()
|
|
1542
|
+
.try_io(Interest::WRITABLE, || (&*self.io).write(buf))
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
/// Tries to write several buffers to the pipe, returning how many bytes
|
|
1546
|
+
/// were written.
|
|
1547
|
+
///
|
|
1548
|
+
/// Data is written from each buffer in order, with the final buffer read
|
|
1549
|
+
/// from possible being only partially consumed. This method behaves
|
|
1550
|
+
/// equivalently to a single call to [`try_write()`] with concatenated
|
|
1551
|
+
/// buffers.
|
|
1552
|
+
///
|
|
1553
|
+
/// This function is usually paired with `writable()`.
|
|
1554
|
+
///
|
|
1555
|
+
/// [`try_write()`]: NamedPipeClient::try_write()
|
|
1556
|
+
///
|
|
1557
|
+
/// # Return
|
|
1558
|
+
///
|
|
1559
|
+
/// If data is successfully written, `Ok(n)` is returned, where `n` is the
|
|
1560
|
+
/// number of bytes written. If the pipe is not ready to write data,
|
|
1561
|
+
/// `Err(io::ErrorKind::WouldBlock)` is returned.
|
|
1562
|
+
///
|
|
1563
|
+
/// # Examples
|
|
1564
|
+
///
|
|
1565
|
+
/// ```no_run
|
|
1566
|
+
/// use tokio::net::windows::named_pipe;
|
|
1567
|
+
/// use std::error::Error;
|
|
1568
|
+
/// use std::io;
|
|
1569
|
+
///
|
|
1570
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-client-try-write-vectored";
|
|
1571
|
+
///
|
|
1572
|
+
/// #[tokio::main]
|
|
1573
|
+
/// async fn main() -> Result<(), Box<dyn Error>> {
|
|
1574
|
+
/// let client = named_pipe::ClientOptions::new().open(PIPE_NAME)?;
|
|
1575
|
+
///
|
|
1576
|
+
/// let bufs = [io::IoSlice::new(b"hello "), io::IoSlice::new(b"world")];
|
|
1577
|
+
///
|
|
1578
|
+
/// loop {
|
|
1579
|
+
/// // Wait for the pipe to be writable
|
|
1580
|
+
/// client.writable().await?;
|
|
1581
|
+
///
|
|
1582
|
+
/// // Try to write data, this may still fail with `WouldBlock`
|
|
1583
|
+
/// // if the readiness event is a false positive.
|
|
1584
|
+
/// match client.try_write_vectored(&bufs) {
|
|
1585
|
+
/// Ok(n) => {
|
|
1586
|
+
/// break;
|
|
1587
|
+
/// }
|
|
1588
|
+
/// Err(e) if e.kind() == io::ErrorKind::WouldBlock => {
|
|
1589
|
+
/// continue;
|
|
1590
|
+
/// }
|
|
1591
|
+
/// Err(e) => {
|
|
1592
|
+
/// return Err(e.into());
|
|
1593
|
+
/// }
|
|
1594
|
+
/// }
|
|
1595
|
+
/// }
|
|
1596
|
+
///
|
|
1597
|
+
/// Ok(())
|
|
1598
|
+
/// }
|
|
1599
|
+
/// ```
|
|
1600
|
+
pub fn try_write_vectored(&self, buf: &[io::IoSlice<'_>]) -> io::Result<usize> {
|
|
1601
|
+
self.io
|
|
1602
|
+
.registration()
|
|
1603
|
+
.try_io(Interest::WRITABLE, || (&*self.io).write_vectored(buf))
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
/// Tries to read or write from the pipe using a user-provided IO operation.
|
|
1607
|
+
///
|
|
1608
|
+
/// If the pipe is ready, the provided closure is called. The closure
|
|
1609
|
+
/// should attempt to perform IO operation from the pipe by manually
|
|
1610
|
+
/// calling the appropriate syscall. If the operation fails because the
|
|
1611
|
+
/// pipe is not actually ready, then the closure should return a
|
|
1612
|
+
/// `WouldBlock` error and the readiness flag is cleared. The return value
|
|
1613
|
+
/// of the closure is then returned by `try_io`.
|
|
1614
|
+
///
|
|
1615
|
+
/// If the pipe is not ready, then the closure is not called
|
|
1616
|
+
/// and a `WouldBlock` error is returned.
|
|
1617
|
+
///
|
|
1618
|
+
/// The closure should only return a `WouldBlock` error if it has performed
|
|
1619
|
+
/// an IO operation on the pipe that failed due to the pipe not being
|
|
1620
|
+
/// ready. Returning a `WouldBlock` error in any other situation will
|
|
1621
|
+
/// incorrectly clear the readiness flag, which can cause the pipe to
|
|
1622
|
+
/// behave incorrectly.
|
|
1623
|
+
///
|
|
1624
|
+
/// The closure should not perform the IO operation using any of the methods
|
|
1625
|
+
/// defined on the Tokio `NamedPipeClient` type, as this will mess with the
|
|
1626
|
+
/// readiness flag and can cause the pipe to behave incorrectly.
|
|
1627
|
+
///
|
|
1628
|
+
/// This method is not intended to be used with combined interests.
|
|
1629
|
+
/// The closure should perform only one type of IO operation, so it should not
|
|
1630
|
+
/// require more than one ready state. This method may panic or sleep forever
|
|
1631
|
+
/// if it is called with a combined interest.
|
|
1632
|
+
///
|
|
1633
|
+
/// Usually, [`readable()`], [`writable()`] or [`ready()`] is used with this function.
|
|
1634
|
+
///
|
|
1635
|
+
/// [`readable()`]: NamedPipeClient::readable()
|
|
1636
|
+
/// [`writable()`]: NamedPipeClient::writable()
|
|
1637
|
+
/// [`ready()`]: NamedPipeClient::ready()
|
|
1638
|
+
pub fn try_io<R>(
|
|
1639
|
+
&self,
|
|
1640
|
+
interest: Interest,
|
|
1641
|
+
f: impl FnOnce() -> io::Result<R>,
|
|
1642
|
+
) -> io::Result<R> {
|
|
1643
|
+
self.io.registration().try_io(interest, f)
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
/// Reads or writes from the pipe using a user-provided IO operation.
|
|
1647
|
+
///
|
|
1648
|
+
/// The readiness of the pipe is awaited and when the pipe is ready,
|
|
1649
|
+
/// the provided closure is called. The closure should attempt to perform
|
|
1650
|
+
/// IO operation on the pipe by manually calling the appropriate syscall.
|
|
1651
|
+
/// If the operation fails because the pipe is not actually ready,
|
|
1652
|
+
/// then the closure should return a `WouldBlock` error. In such case the
|
|
1653
|
+
/// readiness flag is cleared and the pipe readiness is awaited again.
|
|
1654
|
+
/// This loop is repeated until the closure returns an `Ok` or an error
|
|
1655
|
+
/// other than `WouldBlock`.
|
|
1656
|
+
///
|
|
1657
|
+
/// The closure should only return a `WouldBlock` error if it has performed
|
|
1658
|
+
/// an IO operation on the pipe that failed due to the pipe not being
|
|
1659
|
+
/// ready. Returning a `WouldBlock` error in any other situation will
|
|
1660
|
+
/// incorrectly clear the readiness flag, which can cause the pipe to
|
|
1661
|
+
/// behave incorrectly.
|
|
1662
|
+
///
|
|
1663
|
+
/// The closure should not perform the IO operation using any of the methods
|
|
1664
|
+
/// defined on the Tokio `NamedPipeClient` type, as this will mess with the
|
|
1665
|
+
/// readiness flag and can cause the pipe to behave incorrectly.
|
|
1666
|
+
///
|
|
1667
|
+
/// This method is not intended to be used with combined interests.
|
|
1668
|
+
/// The closure should perform only one type of IO operation, so it should not
|
|
1669
|
+
/// require more than one ready state. This method may panic or sleep forever
|
|
1670
|
+
/// if it is called with a combined interest.
|
|
1671
|
+
pub async fn async_io<R>(
|
|
1672
|
+
&self,
|
|
1673
|
+
interest: Interest,
|
|
1674
|
+
f: impl FnMut() -> io::Result<R>,
|
|
1675
|
+
) -> io::Result<R> {
|
|
1676
|
+
self.io.registration().async_io(interest, f).await
|
|
1677
|
+
}
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
impl AsyncRead for NamedPipeClient {
|
|
1681
|
+
fn poll_read(
|
|
1682
|
+
self: Pin<&mut Self>,
|
|
1683
|
+
cx: &mut Context<'_>,
|
|
1684
|
+
buf: &mut ReadBuf<'_>,
|
|
1685
|
+
) -> Poll<io::Result<()>> {
|
|
1686
|
+
unsafe { self.io.poll_read(cx, buf) }
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
impl AsyncWrite for NamedPipeClient {
|
|
1691
|
+
fn poll_write(
|
|
1692
|
+
self: Pin<&mut Self>,
|
|
1693
|
+
cx: &mut Context<'_>,
|
|
1694
|
+
buf: &[u8],
|
|
1695
|
+
) -> Poll<io::Result<usize>> {
|
|
1696
|
+
self.io.poll_write(cx, buf)
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
fn poll_write_vectored(
|
|
1700
|
+
self: Pin<&mut Self>,
|
|
1701
|
+
cx: &mut Context<'_>,
|
|
1702
|
+
bufs: &[io::IoSlice<'_>],
|
|
1703
|
+
) -> Poll<io::Result<usize>> {
|
|
1704
|
+
self.io.poll_write_vectored(cx, bufs)
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<io::Result<()>> {
|
|
1708
|
+
Poll::Ready(Ok(()))
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<()>> {
|
|
1712
|
+
self.poll_flush(cx)
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
impl AsRawHandle for NamedPipeClient {
|
|
1717
|
+
fn as_raw_handle(&self) -> RawHandle {
|
|
1718
|
+
self.io.as_raw_handle()
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
impl AsHandle for NamedPipeClient {
|
|
1723
|
+
fn as_handle(&self) -> BorrowedHandle<'_> {
|
|
1724
|
+
unsafe { BorrowedHandle::borrow_raw(self.as_raw_handle()) }
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
/// A builder structure for construct a named pipe with named pipe-specific
|
|
1729
|
+
/// options. This is required to use for named pipe servers who wants to modify
|
|
1730
|
+
/// pipe-related options.
|
|
1731
|
+
///
|
|
1732
|
+
/// See [`ServerOptions::create`].
|
|
1733
|
+
#[derive(Debug, Clone)]
|
|
1734
|
+
pub struct ServerOptions {
|
|
1735
|
+
// dwOpenMode
|
|
1736
|
+
access_inbound: bool,
|
|
1737
|
+
access_outbound: bool,
|
|
1738
|
+
first_pipe_instance: bool,
|
|
1739
|
+
write_dac: bool,
|
|
1740
|
+
write_owner: bool,
|
|
1741
|
+
access_system_security: bool,
|
|
1742
|
+
// dwPipeMode
|
|
1743
|
+
pipe_mode: PipeMode,
|
|
1744
|
+
reject_remote_clients: bool,
|
|
1745
|
+
// other options
|
|
1746
|
+
max_instances: u32,
|
|
1747
|
+
out_buffer_size: u32,
|
|
1748
|
+
in_buffer_size: u32,
|
|
1749
|
+
default_timeout: u32,
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
impl ServerOptions {
|
|
1753
|
+
/// Creates a new named pipe builder with the default settings.
|
|
1754
|
+
///
|
|
1755
|
+
/// ```
|
|
1756
|
+
/// use tokio::net::windows::named_pipe::ServerOptions;
|
|
1757
|
+
///
|
|
1758
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-new";
|
|
1759
|
+
///
|
|
1760
|
+
/// # #[tokio::main] async fn main() -> std::io::Result<()> {
|
|
1761
|
+
/// let server = ServerOptions::new().create(PIPE_NAME)?;
|
|
1762
|
+
/// # Ok(()) }
|
|
1763
|
+
/// ```
|
|
1764
|
+
pub fn new() -> ServerOptions {
|
|
1765
|
+
ServerOptions {
|
|
1766
|
+
access_inbound: true,
|
|
1767
|
+
access_outbound: true,
|
|
1768
|
+
first_pipe_instance: false,
|
|
1769
|
+
write_dac: false,
|
|
1770
|
+
write_owner: false,
|
|
1771
|
+
access_system_security: false,
|
|
1772
|
+
pipe_mode: PipeMode::Byte,
|
|
1773
|
+
reject_remote_clients: true,
|
|
1774
|
+
max_instances: windows_sys::PIPE_UNLIMITED_INSTANCES,
|
|
1775
|
+
out_buffer_size: 65536,
|
|
1776
|
+
in_buffer_size: 65536,
|
|
1777
|
+
default_timeout: 0,
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
/// The pipe mode.
|
|
1782
|
+
///
|
|
1783
|
+
/// The default pipe mode is [`PipeMode::Byte`]. See [`PipeMode`] for
|
|
1784
|
+
/// documentation of what each mode means.
|
|
1785
|
+
///
|
|
1786
|
+
/// This corresponds to specifying `PIPE_TYPE_` and `PIPE_READMODE_` in [`dwPipeMode`].
|
|
1787
|
+
///
|
|
1788
|
+
/// [`dwPipeMode`]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createnamedpipea
|
|
1789
|
+
pub fn pipe_mode(&mut self, pipe_mode: PipeMode) -> &mut Self {
|
|
1790
|
+
self.pipe_mode = pipe_mode;
|
|
1791
|
+
self
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
/// The flow of data in the pipe goes from client to server only.
|
|
1795
|
+
///
|
|
1796
|
+
/// This corresponds to setting [`PIPE_ACCESS_INBOUND`].
|
|
1797
|
+
///
|
|
1798
|
+
/// [`PIPE_ACCESS_INBOUND`]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createnamedpipea#pipe_access_inbound
|
|
1799
|
+
///
|
|
1800
|
+
/// # Errors
|
|
1801
|
+
///
|
|
1802
|
+
/// Server side prevents connecting by denying inbound access, client errors
|
|
1803
|
+
/// with [`std::io::ErrorKind::PermissionDenied`] when attempting to create
|
|
1804
|
+
/// the connection.
|
|
1805
|
+
///
|
|
1806
|
+
/// ```
|
|
1807
|
+
/// use std::io;
|
|
1808
|
+
/// use tokio::net::windows::named_pipe::{ClientOptions, ServerOptions};
|
|
1809
|
+
///
|
|
1810
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-access-inbound-err1";
|
|
1811
|
+
///
|
|
1812
|
+
/// # #[tokio::main] async fn main() -> io::Result<()> {
|
|
1813
|
+
/// let _server = ServerOptions::new()
|
|
1814
|
+
/// .access_inbound(false)
|
|
1815
|
+
/// .create(PIPE_NAME)?;
|
|
1816
|
+
///
|
|
1817
|
+
/// let e = ClientOptions::new()
|
|
1818
|
+
/// .open(PIPE_NAME)
|
|
1819
|
+
/// .unwrap_err();
|
|
1820
|
+
///
|
|
1821
|
+
/// assert_eq!(e.kind(), io::ErrorKind::PermissionDenied);
|
|
1822
|
+
/// # Ok(()) }
|
|
1823
|
+
/// ```
|
|
1824
|
+
///
|
|
1825
|
+
/// Disabling writing allows a client to connect, but errors with
|
|
1826
|
+
/// [`std::io::ErrorKind::PermissionDenied`] if a write is attempted.
|
|
1827
|
+
///
|
|
1828
|
+
/// ```
|
|
1829
|
+
/// use std::io;
|
|
1830
|
+
/// use tokio::io::AsyncWriteExt;
|
|
1831
|
+
/// use tokio::net::windows::named_pipe::{ClientOptions, ServerOptions};
|
|
1832
|
+
///
|
|
1833
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-access-inbound-err2";
|
|
1834
|
+
///
|
|
1835
|
+
/// # #[tokio::main] async fn main() -> io::Result<()> {
|
|
1836
|
+
/// let server = ServerOptions::new()
|
|
1837
|
+
/// .access_inbound(false)
|
|
1838
|
+
/// .create(PIPE_NAME)?;
|
|
1839
|
+
///
|
|
1840
|
+
/// let mut client = ClientOptions::new()
|
|
1841
|
+
/// .write(false)
|
|
1842
|
+
/// .open(PIPE_NAME)?;
|
|
1843
|
+
///
|
|
1844
|
+
/// server.connect().await?;
|
|
1845
|
+
///
|
|
1846
|
+
/// let e = client.write(b"ping").await.unwrap_err();
|
|
1847
|
+
/// assert_eq!(e.kind(), io::ErrorKind::PermissionDenied);
|
|
1848
|
+
/// # Ok(()) }
|
|
1849
|
+
/// ```
|
|
1850
|
+
///
|
|
1851
|
+
/// # Examples
|
|
1852
|
+
///
|
|
1853
|
+
/// A unidirectional named pipe that only supports server-to-client
|
|
1854
|
+
/// communication.
|
|
1855
|
+
///
|
|
1856
|
+
/// ```
|
|
1857
|
+
/// use std::io;
|
|
1858
|
+
/// use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
|
1859
|
+
/// use tokio::net::windows::named_pipe::{ClientOptions, ServerOptions};
|
|
1860
|
+
///
|
|
1861
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-access-inbound";
|
|
1862
|
+
///
|
|
1863
|
+
/// # #[tokio::main] async fn main() -> io::Result<()> {
|
|
1864
|
+
/// let mut server = ServerOptions::new()
|
|
1865
|
+
/// .access_inbound(false)
|
|
1866
|
+
/// .create(PIPE_NAME)?;
|
|
1867
|
+
///
|
|
1868
|
+
/// let mut client = ClientOptions::new()
|
|
1869
|
+
/// .write(false)
|
|
1870
|
+
/// .open(PIPE_NAME)?;
|
|
1871
|
+
///
|
|
1872
|
+
/// server.connect().await?;
|
|
1873
|
+
///
|
|
1874
|
+
/// let write = server.write_all(b"ping");
|
|
1875
|
+
///
|
|
1876
|
+
/// let mut buf = [0u8; 4];
|
|
1877
|
+
/// let read = client.read_exact(&mut buf);
|
|
1878
|
+
///
|
|
1879
|
+
/// let ((), read) = tokio::try_join!(write, read)?;
|
|
1880
|
+
///
|
|
1881
|
+
/// assert_eq!(read, 4);
|
|
1882
|
+
/// assert_eq!(&buf[..], b"ping");
|
|
1883
|
+
/// # Ok(()) }
|
|
1884
|
+
/// ```
|
|
1885
|
+
pub fn access_inbound(&mut self, allowed: bool) -> &mut Self {
|
|
1886
|
+
self.access_inbound = allowed;
|
|
1887
|
+
self
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
/// The flow of data in the pipe goes from server to client only.
|
|
1891
|
+
///
|
|
1892
|
+
/// This corresponds to setting [`PIPE_ACCESS_OUTBOUND`].
|
|
1893
|
+
///
|
|
1894
|
+
/// [`PIPE_ACCESS_OUTBOUND`]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createnamedpipea#pipe_access_outbound
|
|
1895
|
+
///
|
|
1896
|
+
/// # Errors
|
|
1897
|
+
///
|
|
1898
|
+
/// Server side prevents connecting by denying outbound access, client
|
|
1899
|
+
/// errors with [`std::io::ErrorKind::PermissionDenied`] when attempting to
|
|
1900
|
+
/// create the connection.
|
|
1901
|
+
///
|
|
1902
|
+
/// ```
|
|
1903
|
+
/// use std::io;
|
|
1904
|
+
/// use tokio::net::windows::named_pipe::{ClientOptions, ServerOptions};
|
|
1905
|
+
///
|
|
1906
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-access-outbound-err1";
|
|
1907
|
+
///
|
|
1908
|
+
/// # #[tokio::main] async fn main() -> io::Result<()> {
|
|
1909
|
+
/// let server = ServerOptions::new()
|
|
1910
|
+
/// .access_outbound(false)
|
|
1911
|
+
/// .create(PIPE_NAME)?;
|
|
1912
|
+
///
|
|
1913
|
+
/// let e = ClientOptions::new()
|
|
1914
|
+
/// .open(PIPE_NAME)
|
|
1915
|
+
/// .unwrap_err();
|
|
1916
|
+
///
|
|
1917
|
+
/// assert_eq!(e.kind(), io::ErrorKind::PermissionDenied);
|
|
1918
|
+
/// # Ok(()) }
|
|
1919
|
+
/// ```
|
|
1920
|
+
///
|
|
1921
|
+
/// Disabling reading allows a client to connect, but attempting to read
|
|
1922
|
+
/// will error with [`std::io::ErrorKind::PermissionDenied`].
|
|
1923
|
+
///
|
|
1924
|
+
/// ```
|
|
1925
|
+
/// use std::io;
|
|
1926
|
+
/// use tokio::io::AsyncReadExt;
|
|
1927
|
+
/// use tokio::net::windows::named_pipe::{ClientOptions, ServerOptions};
|
|
1928
|
+
///
|
|
1929
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-access-outbound-err2";
|
|
1930
|
+
///
|
|
1931
|
+
/// # #[tokio::main] async fn main() -> io::Result<()> {
|
|
1932
|
+
/// let server = ServerOptions::new()
|
|
1933
|
+
/// .access_outbound(false)
|
|
1934
|
+
/// .create(PIPE_NAME)?;
|
|
1935
|
+
///
|
|
1936
|
+
/// let mut client = ClientOptions::new()
|
|
1937
|
+
/// .read(false)
|
|
1938
|
+
/// .open(PIPE_NAME)?;
|
|
1939
|
+
///
|
|
1940
|
+
/// server.connect().await?;
|
|
1941
|
+
///
|
|
1942
|
+
/// let mut buf = [0u8; 4];
|
|
1943
|
+
/// let e = client.read(&mut buf).await.unwrap_err();
|
|
1944
|
+
/// assert_eq!(e.kind(), io::ErrorKind::PermissionDenied);
|
|
1945
|
+
/// # Ok(()) }
|
|
1946
|
+
/// ```
|
|
1947
|
+
///
|
|
1948
|
+
/// # Examples
|
|
1949
|
+
///
|
|
1950
|
+
/// A unidirectional named pipe that only supports client-to-server
|
|
1951
|
+
/// communication.
|
|
1952
|
+
///
|
|
1953
|
+
/// ```
|
|
1954
|
+
/// use tokio::io::{AsyncReadExt, AsyncWriteExt};
|
|
1955
|
+
/// use tokio::net::windows::named_pipe::{ClientOptions, ServerOptions};
|
|
1956
|
+
///
|
|
1957
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-access-outbound";
|
|
1958
|
+
///
|
|
1959
|
+
/// # #[tokio::main] async fn main() -> std::io::Result<()> {
|
|
1960
|
+
/// let mut server = ServerOptions::new()
|
|
1961
|
+
/// .access_outbound(false)
|
|
1962
|
+
/// .create(PIPE_NAME)?;
|
|
1963
|
+
///
|
|
1964
|
+
/// let mut client = ClientOptions::new()
|
|
1965
|
+
/// .read(false)
|
|
1966
|
+
/// .open(PIPE_NAME)?;
|
|
1967
|
+
///
|
|
1968
|
+
/// server.connect().await?;
|
|
1969
|
+
///
|
|
1970
|
+
/// let write = client.write_all(b"ping");
|
|
1971
|
+
///
|
|
1972
|
+
/// let mut buf = [0u8; 4];
|
|
1973
|
+
/// let read = server.read_exact(&mut buf);
|
|
1974
|
+
///
|
|
1975
|
+
/// let ((), read) = tokio::try_join!(write, read)?;
|
|
1976
|
+
///
|
|
1977
|
+
/// println!("done reading and writing");
|
|
1978
|
+
///
|
|
1979
|
+
/// assert_eq!(read, 4);
|
|
1980
|
+
/// assert_eq!(&buf[..], b"ping");
|
|
1981
|
+
/// # Ok(()) }
|
|
1982
|
+
/// ```
|
|
1983
|
+
pub fn access_outbound(&mut self, allowed: bool) -> &mut Self {
|
|
1984
|
+
self.access_outbound = allowed;
|
|
1985
|
+
self
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
/// If you attempt to create multiple instances of a pipe with this flag
|
|
1989
|
+
/// set, creation of the first server instance succeeds, but creation of any
|
|
1990
|
+
/// subsequent instances will fail with
|
|
1991
|
+
/// [`std::io::ErrorKind::PermissionDenied`].
|
|
1992
|
+
///
|
|
1993
|
+
/// This option is intended to be used with servers that want to ensure that
|
|
1994
|
+
/// they are the only process listening for clients on a given named pipe.
|
|
1995
|
+
/// This is accomplished by enabling it for the first server instance
|
|
1996
|
+
/// created in a process.
|
|
1997
|
+
///
|
|
1998
|
+
/// This corresponds to setting [`FILE_FLAG_FIRST_PIPE_INSTANCE`].
|
|
1999
|
+
///
|
|
2000
|
+
/// # Errors
|
|
2001
|
+
///
|
|
2002
|
+
/// If this option is set and more than one instance of the server for a
|
|
2003
|
+
/// given named pipe exists, calling [`create`] will fail with
|
|
2004
|
+
/// [`std::io::ErrorKind::PermissionDenied`].
|
|
2005
|
+
///
|
|
2006
|
+
/// ```
|
|
2007
|
+
/// use std::io;
|
|
2008
|
+
/// use tokio::net::windows::named_pipe::ServerOptions;
|
|
2009
|
+
///
|
|
2010
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-first-instance-error";
|
|
2011
|
+
///
|
|
2012
|
+
/// # #[tokio::main] async fn main() -> io::Result<()> {
|
|
2013
|
+
/// let server1 = ServerOptions::new()
|
|
2014
|
+
/// .first_pipe_instance(true)
|
|
2015
|
+
/// .create(PIPE_NAME)?;
|
|
2016
|
+
///
|
|
2017
|
+
/// // Second server errs, since it's not the first instance.
|
|
2018
|
+
/// let e = ServerOptions::new()
|
|
2019
|
+
/// .first_pipe_instance(true)
|
|
2020
|
+
/// .create(PIPE_NAME)
|
|
2021
|
+
/// .unwrap_err();
|
|
2022
|
+
///
|
|
2023
|
+
/// assert_eq!(e.kind(), io::ErrorKind::PermissionDenied);
|
|
2024
|
+
/// # Ok(()) }
|
|
2025
|
+
/// ```
|
|
2026
|
+
///
|
|
2027
|
+
/// # Examples
|
|
2028
|
+
///
|
|
2029
|
+
/// ```
|
|
2030
|
+
/// use std::io;
|
|
2031
|
+
/// use tokio::net::windows::named_pipe::ServerOptions;
|
|
2032
|
+
///
|
|
2033
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-first-instance";
|
|
2034
|
+
///
|
|
2035
|
+
/// # #[tokio::main] async fn main() -> io::Result<()> {
|
|
2036
|
+
/// let mut builder = ServerOptions::new();
|
|
2037
|
+
/// builder.first_pipe_instance(true);
|
|
2038
|
+
///
|
|
2039
|
+
/// let server = builder.create(PIPE_NAME)?;
|
|
2040
|
+
/// let e = builder.create(PIPE_NAME).unwrap_err();
|
|
2041
|
+
/// assert_eq!(e.kind(), io::ErrorKind::PermissionDenied);
|
|
2042
|
+
/// drop(server);
|
|
2043
|
+
///
|
|
2044
|
+
/// // OK: since, we've closed the other instance.
|
|
2045
|
+
/// let _server2 = builder.create(PIPE_NAME)?;
|
|
2046
|
+
/// # Ok(()) }
|
|
2047
|
+
/// ```
|
|
2048
|
+
///
|
|
2049
|
+
/// [`create`]: ServerOptions::create
|
|
2050
|
+
/// [`FILE_FLAG_FIRST_PIPE_INSTANCE`]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createnamedpipea#pipe_first_pipe_instance
|
|
2051
|
+
pub fn first_pipe_instance(&mut self, first: bool) -> &mut Self {
|
|
2052
|
+
self.first_pipe_instance = first;
|
|
2053
|
+
self
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
/// Requests permission to modify the pipe's discretionary access control list.
|
|
2057
|
+
///
|
|
2058
|
+
/// This corresponds to setting [`WRITE_DAC`] in dwOpenMode.
|
|
2059
|
+
///
|
|
2060
|
+
/// # Examples
|
|
2061
|
+
///
|
|
2062
|
+
/// ```
|
|
2063
|
+
/// use std::{io, os::windows::prelude::AsRawHandle, ptr};
|
|
2064
|
+
///
|
|
2065
|
+
/// use tokio::net::windows::named_pipe::ServerOptions;
|
|
2066
|
+
/// use windows_sys::{
|
|
2067
|
+
/// Win32::Foundation::ERROR_SUCCESS,
|
|
2068
|
+
/// Win32::Security::DACL_SECURITY_INFORMATION,
|
|
2069
|
+
/// Win32::Security::Authorization::{SetSecurityInfo, SE_KERNEL_OBJECT},
|
|
2070
|
+
/// };
|
|
2071
|
+
///
|
|
2072
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\write_dac_pipe";
|
|
2073
|
+
///
|
|
2074
|
+
/// # #[tokio::main] async fn main() -> io::Result<()> {
|
|
2075
|
+
/// let mut pipe_template = ServerOptions::new();
|
|
2076
|
+
/// pipe_template.write_dac(true);
|
|
2077
|
+
/// let pipe = pipe_template.create(PIPE_NAME)?;
|
|
2078
|
+
///
|
|
2079
|
+
/// unsafe {
|
|
2080
|
+
/// assert_eq!(
|
|
2081
|
+
/// ERROR_SUCCESS,
|
|
2082
|
+
/// SetSecurityInfo(
|
|
2083
|
+
/// pipe.as_raw_handle() as _,
|
|
2084
|
+
/// SE_KERNEL_OBJECT,
|
|
2085
|
+
/// DACL_SECURITY_INFORMATION,
|
|
2086
|
+
/// ptr::null_mut(),
|
|
2087
|
+
/// ptr::null_mut(),
|
|
2088
|
+
/// ptr::null_mut(),
|
|
2089
|
+
/// ptr::null_mut(),
|
|
2090
|
+
/// )
|
|
2091
|
+
/// );
|
|
2092
|
+
/// }
|
|
2093
|
+
///
|
|
2094
|
+
/// # Ok(()) }
|
|
2095
|
+
/// ```
|
|
2096
|
+
///
|
|
2097
|
+
/// ```
|
|
2098
|
+
/// use std::{io, os::windows::prelude::AsRawHandle, ptr};
|
|
2099
|
+
///
|
|
2100
|
+
/// use tokio::net::windows::named_pipe::ServerOptions;
|
|
2101
|
+
/// use windows_sys::{
|
|
2102
|
+
/// Win32::Foundation::ERROR_ACCESS_DENIED,
|
|
2103
|
+
/// Win32::Security::DACL_SECURITY_INFORMATION,
|
|
2104
|
+
/// Win32::Security::Authorization::{SetSecurityInfo, SE_KERNEL_OBJECT},
|
|
2105
|
+
/// };
|
|
2106
|
+
///
|
|
2107
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\write_dac_pipe_fail";
|
|
2108
|
+
///
|
|
2109
|
+
/// # #[tokio::main] async fn main() -> io::Result<()> {
|
|
2110
|
+
/// let mut pipe_template = ServerOptions::new();
|
|
2111
|
+
/// pipe_template.write_dac(false);
|
|
2112
|
+
/// let pipe = pipe_template.create(PIPE_NAME)?;
|
|
2113
|
+
///
|
|
2114
|
+
/// unsafe {
|
|
2115
|
+
/// assert_eq!(
|
|
2116
|
+
/// ERROR_ACCESS_DENIED,
|
|
2117
|
+
/// SetSecurityInfo(
|
|
2118
|
+
/// pipe.as_raw_handle() as _,
|
|
2119
|
+
/// SE_KERNEL_OBJECT,
|
|
2120
|
+
/// DACL_SECURITY_INFORMATION,
|
|
2121
|
+
/// ptr::null_mut(),
|
|
2122
|
+
/// ptr::null_mut(),
|
|
2123
|
+
/// ptr::null_mut(),
|
|
2124
|
+
/// ptr::null_mut(),
|
|
2125
|
+
/// )
|
|
2126
|
+
/// );
|
|
2127
|
+
/// }
|
|
2128
|
+
///
|
|
2129
|
+
/// # Ok(()) }
|
|
2130
|
+
/// ```
|
|
2131
|
+
///
|
|
2132
|
+
/// [`WRITE_DAC`]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createnamedpipea
|
|
2133
|
+
pub fn write_dac(&mut self, requested: bool) -> &mut Self {
|
|
2134
|
+
self.write_dac = requested;
|
|
2135
|
+
self
|
|
2136
|
+
}
|
|
2137
|
+
|
|
2138
|
+
/// Requests permission to modify the pipe's owner.
|
|
2139
|
+
///
|
|
2140
|
+
/// This corresponds to setting [`WRITE_OWNER`] in dwOpenMode.
|
|
2141
|
+
///
|
|
2142
|
+
/// [`WRITE_OWNER`]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createnamedpipea
|
|
2143
|
+
pub fn write_owner(&mut self, requested: bool) -> &mut Self {
|
|
2144
|
+
self.write_owner = requested;
|
|
2145
|
+
self
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
/// Requests permission to modify the pipe's system access control list.
|
|
2149
|
+
///
|
|
2150
|
+
/// This corresponds to setting [`ACCESS_SYSTEM_SECURITY`] in dwOpenMode.
|
|
2151
|
+
///
|
|
2152
|
+
/// [`ACCESS_SYSTEM_SECURITY`]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createnamedpipea
|
|
2153
|
+
pub fn access_system_security(&mut self, requested: bool) -> &mut Self {
|
|
2154
|
+
self.access_system_security = requested;
|
|
2155
|
+
self
|
|
2156
|
+
}
|
|
2157
|
+
|
|
2158
|
+
/// Indicates whether this server can accept remote clients or not. Remote
|
|
2159
|
+
/// clients are disabled by default.
|
|
2160
|
+
///
|
|
2161
|
+
/// This corresponds to setting [`PIPE_REJECT_REMOTE_CLIENTS`].
|
|
2162
|
+
///
|
|
2163
|
+
/// [`PIPE_REJECT_REMOTE_CLIENTS`]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createnamedpipea#pipe_reject_remote_clients
|
|
2164
|
+
pub fn reject_remote_clients(&mut self, reject: bool) -> &mut Self {
|
|
2165
|
+
self.reject_remote_clients = reject;
|
|
2166
|
+
self
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
/// The maximum number of instances that can be created for this pipe. The
|
|
2170
|
+
/// first instance of the pipe can specify this value; the same number must
|
|
2171
|
+
/// be specified for other instances of the pipe. Acceptable values are in
|
|
2172
|
+
/// the range 1 through 254. The default value is unlimited.
|
|
2173
|
+
///
|
|
2174
|
+
/// This corresponds to specifying [`nMaxInstances`].
|
|
2175
|
+
///
|
|
2176
|
+
/// [`nMaxInstances`]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createnamedpipea
|
|
2177
|
+
///
|
|
2178
|
+
/// # Errors
|
|
2179
|
+
///
|
|
2180
|
+
/// The same numbers of `max_instances` have to be used by all servers. Any
|
|
2181
|
+
/// additional servers trying to be built which uses a mismatching value
|
|
2182
|
+
/// might error.
|
|
2183
|
+
///
|
|
2184
|
+
/// ```
|
|
2185
|
+
/// use std::io;
|
|
2186
|
+
/// use tokio::net::windows::named_pipe::{ServerOptions, ClientOptions};
|
|
2187
|
+
/// use windows_sys::Win32::Foundation::ERROR_PIPE_BUSY;
|
|
2188
|
+
///
|
|
2189
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-max-instances";
|
|
2190
|
+
///
|
|
2191
|
+
/// # #[tokio::main] async fn main() -> io::Result<()> {
|
|
2192
|
+
/// let mut server = ServerOptions::new();
|
|
2193
|
+
/// server.max_instances(2);
|
|
2194
|
+
///
|
|
2195
|
+
/// let s1 = server.create(PIPE_NAME)?;
|
|
2196
|
+
/// let c1 = ClientOptions::new().open(PIPE_NAME);
|
|
2197
|
+
///
|
|
2198
|
+
/// let s2 = server.create(PIPE_NAME)?;
|
|
2199
|
+
/// let c2 = ClientOptions::new().open(PIPE_NAME);
|
|
2200
|
+
///
|
|
2201
|
+
/// // Too many servers!
|
|
2202
|
+
/// let e = server.create(PIPE_NAME).unwrap_err();
|
|
2203
|
+
/// assert_eq!(e.raw_os_error(), Some(ERROR_PIPE_BUSY as i32));
|
|
2204
|
+
///
|
|
2205
|
+
/// // Still too many servers even if we specify a higher value!
|
|
2206
|
+
/// let e = server.max_instances(100).create(PIPE_NAME).unwrap_err();
|
|
2207
|
+
/// assert_eq!(e.raw_os_error(), Some(ERROR_PIPE_BUSY as i32));
|
|
2208
|
+
/// # Ok(()) }
|
|
2209
|
+
/// ```
|
|
2210
|
+
///
|
|
2211
|
+
/// # Panics
|
|
2212
|
+
///
|
|
2213
|
+
/// This function will panic if more than 254 instances are specified. If
|
|
2214
|
+
/// you do not wish to set an instance limit, leave it unspecified.
|
|
2215
|
+
///
|
|
2216
|
+
/// ```should_panic
|
|
2217
|
+
/// use tokio::net::windows::named_pipe::ServerOptions;
|
|
2218
|
+
///
|
|
2219
|
+
/// # #[tokio::main] async fn main() -> std::io::Result<()> {
|
|
2220
|
+
/// let builder = ServerOptions::new().max_instances(255);
|
|
2221
|
+
/// # Ok(()) }
|
|
2222
|
+
/// ```
|
|
2223
|
+
#[track_caller]
|
|
2224
|
+
pub fn max_instances(&mut self, instances: usize) -> &mut Self {
|
|
2225
|
+
assert!(instances < 255, "cannot specify more than 254 instances");
|
|
2226
|
+
self.max_instances = instances as u32;
|
|
2227
|
+
self
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
/// The number of bytes to reserve for the output buffer.
|
|
2231
|
+
///
|
|
2232
|
+
/// This corresponds to specifying [`nOutBufferSize`].
|
|
2233
|
+
///
|
|
2234
|
+
/// [`nOutBufferSize`]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createnamedpipea
|
|
2235
|
+
pub fn out_buffer_size(&mut self, buffer: u32) -> &mut Self {
|
|
2236
|
+
self.out_buffer_size = buffer;
|
|
2237
|
+
self
|
|
2238
|
+
}
|
|
2239
|
+
|
|
2240
|
+
/// The number of bytes to reserve for the input buffer.
|
|
2241
|
+
///
|
|
2242
|
+
/// This corresponds to specifying [`nInBufferSize`].
|
|
2243
|
+
///
|
|
2244
|
+
/// [`nInBufferSize`]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createnamedpipea
|
|
2245
|
+
pub fn in_buffer_size(&mut self, buffer: u32) -> &mut Self {
|
|
2246
|
+
self.in_buffer_size = buffer;
|
|
2247
|
+
self
|
|
2248
|
+
}
|
|
2249
|
+
|
|
2250
|
+
/// Creates the named pipe identified by `addr` for use as a server.
|
|
2251
|
+
///
|
|
2252
|
+
/// This uses the [`CreateNamedPipe`] function.
|
|
2253
|
+
///
|
|
2254
|
+
/// [`CreateNamedPipe`]: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createnamedpipea
|
|
2255
|
+
///
|
|
2256
|
+
/// # Errors
|
|
2257
|
+
///
|
|
2258
|
+
/// This errors if called outside of a [Tokio Runtime], or in a runtime that
|
|
2259
|
+
/// has not [enabled I/O], or if any OS-specific I/O errors occur.
|
|
2260
|
+
///
|
|
2261
|
+
/// [Tokio Runtime]: crate::runtime::Runtime
|
|
2262
|
+
/// [enabled I/O]: crate::runtime::Builder::enable_io
|
|
2263
|
+
///
|
|
2264
|
+
/// # Examples
|
|
2265
|
+
///
|
|
2266
|
+
/// ```
|
|
2267
|
+
/// use tokio::net::windows::named_pipe::ServerOptions;
|
|
2268
|
+
///
|
|
2269
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-create";
|
|
2270
|
+
///
|
|
2271
|
+
/// # #[tokio::main] async fn main() -> std::io::Result<()> {
|
|
2272
|
+
/// let server = ServerOptions::new().create(PIPE_NAME)?;
|
|
2273
|
+
/// # Ok(()) }
|
|
2274
|
+
/// ```
|
|
2275
|
+
pub fn create(&self, addr: impl AsRef<OsStr>) -> io::Result<NamedPipeServer> {
|
|
2276
|
+
// Safety: We're calling create_with_security_attributes_raw w/ a null
|
|
2277
|
+
// pointer which disables it.
|
|
2278
|
+
unsafe { self.create_with_security_attributes_raw(addr, ptr::null_mut()) }
|
|
2279
|
+
}
|
|
2280
|
+
|
|
2281
|
+
/// Creates the named pipe identified by `addr` for use as a server.
|
|
2282
|
+
///
|
|
2283
|
+
/// This is the same as [`create`] except that it supports providing the raw
|
|
2284
|
+
/// pointer to a structure of [`SECURITY_ATTRIBUTES`] which will be passed
|
|
2285
|
+
/// as the `lpSecurityAttributes` argument to [`CreateFile`].
|
|
2286
|
+
///
|
|
2287
|
+
/// # Errors
|
|
2288
|
+
///
|
|
2289
|
+
/// This errors if called outside of a [Tokio Runtime], or in a runtime that
|
|
2290
|
+
/// has not [enabled I/O], or if any OS-specific I/O errors occur.
|
|
2291
|
+
///
|
|
2292
|
+
/// [Tokio Runtime]: crate::runtime::Runtime
|
|
2293
|
+
/// [enabled I/O]: crate::runtime::Builder::enable_io
|
|
2294
|
+
///
|
|
2295
|
+
/// # Safety
|
|
2296
|
+
///
|
|
2297
|
+
/// The `attrs` argument must either be null or point at a valid instance of
|
|
2298
|
+
/// the [`SECURITY_ATTRIBUTES`] structure. If the argument is null, the
|
|
2299
|
+
/// behavior is identical to calling the [`create`] method.
|
|
2300
|
+
///
|
|
2301
|
+
/// [`create`]: ServerOptions::create
|
|
2302
|
+
/// [`CreateFile`]: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew
|
|
2303
|
+
/// [`SECURITY_ATTRIBUTES`]: https://docs.rs/windows-sys/latest/windows_sys/Win32/Security/struct.SECURITY_ATTRIBUTES.html
|
|
2304
|
+
pub unsafe fn create_with_security_attributes_raw(
|
|
2305
|
+
&self,
|
|
2306
|
+
addr: impl AsRef<OsStr>,
|
|
2307
|
+
attrs: *mut c_void,
|
|
2308
|
+
) -> io::Result<NamedPipeServer> {
|
|
2309
|
+
let addr = encode_addr(addr);
|
|
2310
|
+
|
|
2311
|
+
let pipe_mode = {
|
|
2312
|
+
let mut mode = if matches!(self.pipe_mode, PipeMode::Message) {
|
|
2313
|
+
windows_sys::PIPE_TYPE_MESSAGE | windows_sys::PIPE_READMODE_MESSAGE
|
|
2314
|
+
} else {
|
|
2315
|
+
windows_sys::PIPE_TYPE_BYTE | windows_sys::PIPE_READMODE_BYTE
|
|
2316
|
+
};
|
|
2317
|
+
if self.reject_remote_clients {
|
|
2318
|
+
mode |= windows_sys::PIPE_REJECT_REMOTE_CLIENTS;
|
|
2319
|
+
} else {
|
|
2320
|
+
mode |= windows_sys::PIPE_ACCEPT_REMOTE_CLIENTS;
|
|
2321
|
+
}
|
|
2322
|
+
mode
|
|
2323
|
+
};
|
|
2324
|
+
let open_mode = {
|
|
2325
|
+
let mut mode = windows_sys::FILE_FLAG_OVERLAPPED;
|
|
2326
|
+
if self.access_inbound {
|
|
2327
|
+
mode |= windows_sys::PIPE_ACCESS_INBOUND;
|
|
2328
|
+
}
|
|
2329
|
+
if self.access_outbound {
|
|
2330
|
+
mode |= windows_sys::PIPE_ACCESS_OUTBOUND;
|
|
2331
|
+
}
|
|
2332
|
+
if self.first_pipe_instance {
|
|
2333
|
+
mode |= windows_sys::FILE_FLAG_FIRST_PIPE_INSTANCE;
|
|
2334
|
+
}
|
|
2335
|
+
if self.write_dac {
|
|
2336
|
+
mode |= windows_sys::WRITE_DAC;
|
|
2337
|
+
}
|
|
2338
|
+
if self.write_owner {
|
|
2339
|
+
mode |= windows_sys::WRITE_OWNER;
|
|
2340
|
+
}
|
|
2341
|
+
if self.access_system_security {
|
|
2342
|
+
mode |= windows_sys::ACCESS_SYSTEM_SECURITY;
|
|
2343
|
+
}
|
|
2344
|
+
mode
|
|
2345
|
+
};
|
|
2346
|
+
|
|
2347
|
+
let h = unsafe {
|
|
2348
|
+
windows_sys::CreateNamedPipeW(
|
|
2349
|
+
addr.as_ptr(),
|
|
2350
|
+
open_mode,
|
|
2351
|
+
pipe_mode,
|
|
2352
|
+
self.max_instances,
|
|
2353
|
+
self.out_buffer_size,
|
|
2354
|
+
self.in_buffer_size,
|
|
2355
|
+
self.default_timeout,
|
|
2356
|
+
attrs as *mut _,
|
|
2357
|
+
)
|
|
2358
|
+
};
|
|
2359
|
+
|
|
2360
|
+
if h == windows_sys::INVALID_HANDLE_VALUE {
|
|
2361
|
+
return Err(io::Error::last_os_error());
|
|
2362
|
+
}
|
|
2363
|
+
|
|
2364
|
+
unsafe { NamedPipeServer::from_raw_handle(h as _) }
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2368
|
+
/// A builder suitable for building and interacting with named pipes from the
|
|
2369
|
+
/// client side.
|
|
2370
|
+
///
|
|
2371
|
+
/// See [`ClientOptions::open`].
|
|
2372
|
+
#[derive(Debug, Clone)]
|
|
2373
|
+
pub struct ClientOptions {
|
|
2374
|
+
generic_read: bool,
|
|
2375
|
+
generic_write: bool,
|
|
2376
|
+
security_qos_flags: u32,
|
|
2377
|
+
pipe_mode: PipeMode,
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
impl ClientOptions {
|
|
2381
|
+
/// Creates a new named pipe builder with the default settings.
|
|
2382
|
+
///
|
|
2383
|
+
/// ```
|
|
2384
|
+
/// use tokio::net::windows::named_pipe::{ServerOptions, ClientOptions};
|
|
2385
|
+
///
|
|
2386
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\tokio-named-pipe-client-new";
|
|
2387
|
+
///
|
|
2388
|
+
/// # #[tokio::main] async fn main() -> std::io::Result<()> {
|
|
2389
|
+
/// // Server must be created in order for the client creation to succeed.
|
|
2390
|
+
/// let server = ServerOptions::new().create(PIPE_NAME)?;
|
|
2391
|
+
/// let client = ClientOptions::new().open(PIPE_NAME)?;
|
|
2392
|
+
/// # Ok(()) }
|
|
2393
|
+
/// ```
|
|
2394
|
+
pub fn new() -> Self {
|
|
2395
|
+
Self {
|
|
2396
|
+
generic_read: true,
|
|
2397
|
+
generic_write: true,
|
|
2398
|
+
security_qos_flags: windows_sys::SECURITY_IDENTIFICATION
|
|
2399
|
+
| windows_sys::SECURITY_SQOS_PRESENT,
|
|
2400
|
+
pipe_mode: PipeMode::Byte,
|
|
2401
|
+
}
|
|
2402
|
+
}
|
|
2403
|
+
|
|
2404
|
+
/// If the client supports reading data. This is enabled by default.
|
|
2405
|
+
///
|
|
2406
|
+
/// This corresponds to setting [`GENERIC_READ`] in the call to [`CreateFile`].
|
|
2407
|
+
///
|
|
2408
|
+
/// [`GENERIC_READ`]: https://docs.microsoft.com/en-us/windows/win32/secauthz/generic-access-rights
|
|
2409
|
+
/// [`CreateFile`]: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew
|
|
2410
|
+
pub fn read(&mut self, allowed: bool) -> &mut Self {
|
|
2411
|
+
self.generic_read = allowed;
|
|
2412
|
+
self
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2415
|
+
/// If the created pipe supports writing data. This is enabled by default.
|
|
2416
|
+
///
|
|
2417
|
+
/// This corresponds to setting [`GENERIC_WRITE`] in the call to [`CreateFile`].
|
|
2418
|
+
///
|
|
2419
|
+
/// [`GENERIC_WRITE`]: https://docs.microsoft.com/en-us/windows/win32/secauthz/generic-access-rights
|
|
2420
|
+
/// [`CreateFile`]: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew
|
|
2421
|
+
pub fn write(&mut self, allowed: bool) -> &mut Self {
|
|
2422
|
+
self.generic_write = allowed;
|
|
2423
|
+
self
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2426
|
+
/// Sets qos flags which are combined with other flags and attributes in the
|
|
2427
|
+
/// call to [`CreateFile`].
|
|
2428
|
+
///
|
|
2429
|
+
/// By default `security_qos_flags` is set to [`SECURITY_IDENTIFICATION`],
|
|
2430
|
+
/// calling this function would override that value completely with the
|
|
2431
|
+
/// argument specified.
|
|
2432
|
+
///
|
|
2433
|
+
/// When `security_qos_flags` is not set, a malicious program can gain the
|
|
2434
|
+
/// elevated privileges of a privileged Rust process when it allows opening
|
|
2435
|
+
/// user-specified paths, by tricking it into opening a named pipe. So
|
|
2436
|
+
/// arguably `security_qos_flags` should also be set when opening arbitrary
|
|
2437
|
+
/// paths. However the bits can then conflict with other flags, specifically
|
|
2438
|
+
/// `FILE_FLAG_OPEN_NO_RECALL`.
|
|
2439
|
+
///
|
|
2440
|
+
/// For information about possible values, see [Impersonation Levels] on the
|
|
2441
|
+
/// Windows Dev Center site. The `SECURITY_SQOS_PRESENT` flag is set
|
|
2442
|
+
/// automatically when using this method.
|
|
2443
|
+
///
|
|
2444
|
+
/// [`CreateFile`]: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea
|
|
2445
|
+
/// [`SECURITY_IDENTIFICATION`]: https://docs.rs/windows-sys/latest/windows_sys/Win32/Storage/FileSystem/constant.SECURITY_IDENTIFICATION.html
|
|
2446
|
+
/// [Impersonation Levels]: https://docs.microsoft.com/en-us/windows/win32/api/winnt/ne-winnt-security_impersonation_level
|
|
2447
|
+
pub fn security_qos_flags(&mut self, flags: u32) -> &mut Self {
|
|
2448
|
+
// See: https://github.com/rust-lang/rust/pull/58216
|
|
2449
|
+
self.security_qos_flags = flags | windows_sys::SECURITY_SQOS_PRESENT;
|
|
2450
|
+
self
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
/// The pipe mode.
|
|
2454
|
+
///
|
|
2455
|
+
/// The default pipe mode is [`PipeMode::Byte`]. See [`PipeMode`] for
|
|
2456
|
+
/// documentation of what each mode means.
|
|
2457
|
+
pub fn pipe_mode(&mut self, pipe_mode: PipeMode) -> &mut Self {
|
|
2458
|
+
self.pipe_mode = pipe_mode;
|
|
2459
|
+
self
|
|
2460
|
+
}
|
|
2461
|
+
|
|
2462
|
+
/// Opens the named pipe identified by `addr`.
|
|
2463
|
+
///
|
|
2464
|
+
/// This opens the client using [`CreateFile`] with the
|
|
2465
|
+
/// `dwCreationDisposition` option set to `OPEN_EXISTING`.
|
|
2466
|
+
///
|
|
2467
|
+
/// [`CreateFile`]: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea
|
|
2468
|
+
///
|
|
2469
|
+
/// # Errors
|
|
2470
|
+
///
|
|
2471
|
+
/// This errors if called outside of a [Tokio Runtime], or in a runtime that
|
|
2472
|
+
/// has not [enabled I/O], or if any OS-specific I/O errors occur.
|
|
2473
|
+
///
|
|
2474
|
+
/// There are a few errors you need to take into account when creating a
|
|
2475
|
+
/// named pipe on the client side:
|
|
2476
|
+
///
|
|
2477
|
+
/// * [`std::io::ErrorKind::NotFound`] - This indicates that the named pipe
|
|
2478
|
+
/// does not exist. Presumably the server is not up.
|
|
2479
|
+
/// * [`ERROR_PIPE_BUSY`] - This error is raised when the named pipe exists,
|
|
2480
|
+
/// but the server is not currently waiting for a connection. Please see the
|
|
2481
|
+
/// examples for how to check for this error.
|
|
2482
|
+
///
|
|
2483
|
+
/// [`ERROR_PIPE_BUSY`]: https://docs.rs/windows-sys/latest/windows_sys/Win32/Foundation/constant.ERROR_PIPE_BUSY.html
|
|
2484
|
+
/// [enabled I/O]: crate::runtime::Builder::enable_io
|
|
2485
|
+
/// [Tokio Runtime]: crate::runtime::Runtime
|
|
2486
|
+
///
|
|
2487
|
+
/// A connect loop that waits until a pipe becomes available looks like
|
|
2488
|
+
/// this:
|
|
2489
|
+
///
|
|
2490
|
+
/// ```no_run
|
|
2491
|
+
/// use std::time::Duration;
|
|
2492
|
+
/// use tokio::net::windows::named_pipe::ClientOptions;
|
|
2493
|
+
/// use tokio::time;
|
|
2494
|
+
/// use windows_sys::Win32::Foundation::ERROR_PIPE_BUSY;
|
|
2495
|
+
///
|
|
2496
|
+
/// const PIPE_NAME: &str = r"\\.\pipe\mynamedpipe";
|
|
2497
|
+
///
|
|
2498
|
+
/// # #[tokio::main] async fn main() -> std::io::Result<()> {
|
|
2499
|
+
/// let client = loop {
|
|
2500
|
+
/// match ClientOptions::new().open(PIPE_NAME) {
|
|
2501
|
+
/// Ok(client) => break client,
|
|
2502
|
+
/// Err(e) if e.raw_os_error() == Some(ERROR_PIPE_BUSY as i32) => (),
|
|
2503
|
+
/// Err(e) => return Err(e),
|
|
2504
|
+
/// }
|
|
2505
|
+
///
|
|
2506
|
+
/// time::sleep(Duration::from_millis(50)).await;
|
|
2507
|
+
/// };
|
|
2508
|
+
///
|
|
2509
|
+
/// // use the connected client.
|
|
2510
|
+
/// # Ok(()) }
|
|
2511
|
+
/// ```
|
|
2512
|
+
pub fn open(&self, addr: impl AsRef<OsStr>) -> io::Result<NamedPipeClient> {
|
|
2513
|
+
// Safety: We're calling open_with_security_attributes_raw w/ a null
|
|
2514
|
+
// pointer which disables it.
|
|
2515
|
+
unsafe { self.open_with_security_attributes_raw(addr, ptr::null_mut()) }
|
|
2516
|
+
}
|
|
2517
|
+
|
|
2518
|
+
/// Opens the named pipe identified by `addr`.
|
|
2519
|
+
///
|
|
2520
|
+
/// This is the same as [`open`] except that it supports providing the raw
|
|
2521
|
+
/// pointer to a structure of [`SECURITY_ATTRIBUTES`] which will be passed
|
|
2522
|
+
/// as the `lpSecurityAttributes` argument to [`CreateFile`].
|
|
2523
|
+
///
|
|
2524
|
+
/// # Safety
|
|
2525
|
+
///
|
|
2526
|
+
/// The `attrs` argument must either be null or point at a valid instance of
|
|
2527
|
+
/// the [`SECURITY_ATTRIBUTES`] structure. If the argument is null, the
|
|
2528
|
+
/// behavior is identical to calling the [`open`] method.
|
|
2529
|
+
///
|
|
2530
|
+
/// [`open`]: ClientOptions::open
|
|
2531
|
+
/// [`CreateFile`]: https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilew
|
|
2532
|
+
/// [`SECURITY_ATTRIBUTES`]: https://docs.rs/windows-sys/latest/windows_sys/Win32/Security/struct.SECURITY_ATTRIBUTES.html
|
|
2533
|
+
pub unsafe fn open_with_security_attributes_raw(
|
|
2534
|
+
&self,
|
|
2535
|
+
addr: impl AsRef<OsStr>,
|
|
2536
|
+
attrs: *mut c_void,
|
|
2537
|
+
) -> io::Result<NamedPipeClient> {
|
|
2538
|
+
let addr = encode_addr(addr);
|
|
2539
|
+
|
|
2540
|
+
let desired_access = {
|
|
2541
|
+
let mut access = 0;
|
|
2542
|
+
if self.generic_read {
|
|
2543
|
+
access |= windows_sys::GENERIC_READ;
|
|
2544
|
+
}
|
|
2545
|
+
if self.generic_write {
|
|
2546
|
+
access |= windows_sys::GENERIC_WRITE;
|
|
2547
|
+
}
|
|
2548
|
+
access
|
|
2549
|
+
};
|
|
2550
|
+
|
|
2551
|
+
// NB: We could use a platform specialized `OpenOptions` here, but since
|
|
2552
|
+
// we have access to windows_sys it ultimately doesn't hurt to use
|
|
2553
|
+
// `CreateFile` explicitly since it allows the use of our already
|
|
2554
|
+
// well-structured wide `addr` to pass into CreateFileW.
|
|
2555
|
+
let h = unsafe {
|
|
2556
|
+
windows_sys::CreateFileW(
|
|
2557
|
+
addr.as_ptr(),
|
|
2558
|
+
desired_access,
|
|
2559
|
+
0,
|
|
2560
|
+
attrs as *mut _,
|
|
2561
|
+
windows_sys::OPEN_EXISTING,
|
|
2562
|
+
self.get_flags(),
|
|
2563
|
+
null_mut(),
|
|
2564
|
+
)
|
|
2565
|
+
};
|
|
2566
|
+
|
|
2567
|
+
if h == windows_sys::INVALID_HANDLE_VALUE {
|
|
2568
|
+
return Err(io::Error::last_os_error());
|
|
2569
|
+
}
|
|
2570
|
+
|
|
2571
|
+
if matches!(self.pipe_mode, PipeMode::Message) {
|
|
2572
|
+
let mode = windows_sys::PIPE_READMODE_MESSAGE;
|
|
2573
|
+
let result = unsafe {
|
|
2574
|
+
windows_sys::SetNamedPipeHandleState(h, &mode, ptr::null_mut(), ptr::null_mut())
|
|
2575
|
+
};
|
|
2576
|
+
|
|
2577
|
+
if result == 0 {
|
|
2578
|
+
return Err(io::Error::last_os_error());
|
|
2579
|
+
}
|
|
2580
|
+
}
|
|
2581
|
+
|
|
2582
|
+
unsafe { NamedPipeClient::from_raw_handle(h as _) }
|
|
2583
|
+
}
|
|
2584
|
+
|
|
2585
|
+
fn get_flags(&self) -> u32 {
|
|
2586
|
+
self.security_qos_flags | windows_sys::FILE_FLAG_OVERLAPPED
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
|
|
2590
|
+
/// The pipe mode of a named pipe.
|
|
2591
|
+
///
|
|
2592
|
+
/// Set through [`ServerOptions::pipe_mode`].
|
|
2593
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
|
2594
|
+
#[non_exhaustive]
|
|
2595
|
+
pub enum PipeMode {
|
|
2596
|
+
/// Data is written to the pipe as a stream of bytes. The pipe does not
|
|
2597
|
+
/// distinguish bytes written during different write operations.
|
|
2598
|
+
///
|
|
2599
|
+
/// Corresponds to [`PIPE_TYPE_BYTE`].
|
|
2600
|
+
///
|
|
2601
|
+
/// [`PIPE_TYPE_BYTE`]: https://docs.rs/windows-sys/latest/windows_sys/Win32/System/Pipes/constant.PIPE_TYPE_BYTE.html
|
|
2602
|
+
Byte,
|
|
2603
|
+
/// Data is written to the pipe as a stream of messages. The pipe treats the
|
|
2604
|
+
/// bytes written during each write operation as a message unit. Any reading
|
|
2605
|
+
/// on a named pipe returns [`ERROR_MORE_DATA`] when a message is not read
|
|
2606
|
+
/// completely.
|
|
2607
|
+
///
|
|
2608
|
+
/// Corresponds to [`PIPE_TYPE_MESSAGE`].
|
|
2609
|
+
///
|
|
2610
|
+
/// [`ERROR_MORE_DATA`]: https://docs.rs/windows-sys/latest/windows_sys/Win32/Foundation/constant.ERROR_MORE_DATA.html
|
|
2611
|
+
/// [`PIPE_TYPE_MESSAGE`]: https://docs.rs/windows-sys/latest/windows_sys/Win32/System/Pipes/constant.PIPE_TYPE_MESSAGE.html
|
|
2612
|
+
Message,
|
|
2613
|
+
}
|
|
2614
|
+
|
|
2615
|
+
/// Indicates the end of a named pipe.
|
|
2616
|
+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
|
2617
|
+
#[non_exhaustive]
|
|
2618
|
+
pub enum PipeEnd {
|
|
2619
|
+
/// The named pipe refers to the client end of a named pipe instance.
|
|
2620
|
+
///
|
|
2621
|
+
/// Corresponds to [`PIPE_CLIENT_END`].
|
|
2622
|
+
///
|
|
2623
|
+
/// [`PIPE_CLIENT_END`]: https://docs.rs/windows-sys/latest/windows_sys/Win32/System/Pipes/constant.PIPE_CLIENT_END.html
|
|
2624
|
+
Client,
|
|
2625
|
+
/// The named pipe refers to the server end of a named pipe instance.
|
|
2626
|
+
///
|
|
2627
|
+
/// Corresponds to [`PIPE_SERVER_END`].
|
|
2628
|
+
///
|
|
2629
|
+
/// [`PIPE_SERVER_END`]: https://docs.rs/windows-sys/latest/windows_sys/Win32/System/Pipes/constant.PIPE_SERVER_END.html
|
|
2630
|
+
Server,
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
/// Information about a named pipe.
|
|
2634
|
+
///
|
|
2635
|
+
/// Constructed through [`NamedPipeServer::info`] or [`NamedPipeClient::info`].
|
|
2636
|
+
#[derive(Debug, Clone)]
|
|
2637
|
+
#[non_exhaustive]
|
|
2638
|
+
pub struct PipeInfo {
|
|
2639
|
+
/// Indicates the mode of a named pipe.
|
|
2640
|
+
pub mode: PipeMode,
|
|
2641
|
+
/// Indicates the end of a named pipe.
|
|
2642
|
+
pub end: PipeEnd,
|
|
2643
|
+
/// The maximum number of instances that can be created for this pipe.
|
|
2644
|
+
pub max_instances: u32,
|
|
2645
|
+
/// The number of bytes to reserve for the output buffer.
|
|
2646
|
+
pub out_buffer_size: u32,
|
|
2647
|
+
/// The number of bytes to reserve for the input buffer.
|
|
2648
|
+
pub in_buffer_size: u32,
|
|
2649
|
+
}
|
|
2650
|
+
|
|
2651
|
+
/// Encodes an address so that it is a null-terminated wide string.
|
|
2652
|
+
fn encode_addr(addr: impl AsRef<OsStr>) -> Box<[u16]> {
|
|
2653
|
+
let len = addr.as_ref().encode_wide().count();
|
|
2654
|
+
let mut vec = Vec::with_capacity(len + 1);
|
|
2655
|
+
vec.extend(addr.as_ref().encode_wide());
|
|
2656
|
+
vec.push(0);
|
|
2657
|
+
vec.into_boxed_slice()
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2660
|
+
/// Internal function to get the info out of a raw named pipe.
|
|
2661
|
+
unsafe fn named_pipe_info(handle: RawHandle) -> io::Result<PipeInfo> {
|
|
2662
|
+
let mut flags = 0;
|
|
2663
|
+
let mut out_buffer_size = 0;
|
|
2664
|
+
let mut in_buffer_size = 0;
|
|
2665
|
+
let mut max_instances = 0;
|
|
2666
|
+
|
|
2667
|
+
let result = unsafe {
|
|
2668
|
+
windows_sys::GetNamedPipeInfo(
|
|
2669
|
+
handle as _,
|
|
2670
|
+
&mut flags,
|
|
2671
|
+
&mut out_buffer_size,
|
|
2672
|
+
&mut in_buffer_size,
|
|
2673
|
+
&mut max_instances,
|
|
2674
|
+
)
|
|
2675
|
+
};
|
|
2676
|
+
|
|
2677
|
+
if result == 0 {
|
|
2678
|
+
return Err(io::Error::last_os_error());
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
let mut end = PipeEnd::Client;
|
|
2682
|
+
let mut mode = PipeMode::Byte;
|
|
2683
|
+
|
|
2684
|
+
if flags & windows_sys::PIPE_SERVER_END != 0 {
|
|
2685
|
+
end = PipeEnd::Server;
|
|
2686
|
+
}
|
|
2687
|
+
|
|
2688
|
+
if flags & windows_sys::PIPE_TYPE_MESSAGE != 0 {
|
|
2689
|
+
mode = PipeMode::Message;
|
|
2690
|
+
}
|
|
2691
|
+
|
|
2692
|
+
Ok(PipeInfo {
|
|
2693
|
+
end,
|
|
2694
|
+
mode,
|
|
2695
|
+
out_buffer_size,
|
|
2696
|
+
in_buffer_size,
|
|
2697
|
+
max_instances,
|
|
2698
|
+
})
|
|
2699
|
+
}
|