Full Code of tokio-rs/tokio for AI

master 66c786540ec0 cached
842 files
5.5 MB
1.5M tokens
7948 symbols
1 requests
Download .txt
Showing preview only (5,891K chars total). Download the full file or copy to clipboard to get everything.
Repository: tokio-rs/tokio
Branch: master
Commit: 66c786540ec0
Files: 842
Total size: 5.5 MB

Directory structure:
gitextract_ww3yh_j1/

├── .cirrus.yml
├── .github/
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   ├── config.yml
│   │   └── feature_request.md
│   ├── PULL_REQUEST_TEMPLATE.md
│   ├── buildomat/
│   │   ├── README.md
│   │   └── config.toml
│   ├── labeler.yml
│   └── workflows/
│       ├── audit.yml
│       ├── ci.yml
│       ├── labeler.yml
│       ├── loom.yml
│       ├── pr-audit.yml
│       ├── stress-test.yml
│       └── uring-kernel-version-test.yml
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Cargo.toml
├── Cross.toml
├── LICENSE
├── README.md
├── SECURITY.md
├── benches/
│   ├── Cargo.toml
│   ├── copy.rs
│   ├── fs.rs
│   ├── remote_spawn.rs
│   ├── rt_current_thread.rs
│   ├── rt_multi_threaded.rs
│   ├── signal.rs
│   ├── spawn.rs
│   ├── spawn_blocking.rs
│   ├── sync_broadcast.rs
│   ├── sync_mpsc.rs
│   ├── sync_mpsc_oneshot.rs
│   ├── sync_notify.rs
│   ├── sync_rwlock.rs
│   ├── sync_semaphore.rs
│   ├── sync_watch.rs
│   ├── time_now.rs
│   └── time_timeout.rs
├── deny.toml
├── docs/
│   └── contributing/
│       ├── README.md
│       ├── contributing-in-issues.md
│       ├── how-to-specify-crates-dependencies-versions.md
│       ├── keeping-track-of-issues-and-prs.md
│       ├── pull-requests.md
│       └── reviewing-pull-requests.md
├── examples/
│   ├── Cargo.toml
│   ├── README.md
│   ├── chat.rs
│   ├── connect-tcp.rs
│   ├── connect-udp.rs
│   ├── custom-executor-tokio-context.rs
│   ├── custom-executor.rs
│   ├── dump.rs
│   ├── echo-tcp.rs
│   ├── echo-udp.rs
│   ├── hello_world.rs
│   ├── named-pipe-multi-client.rs
│   ├── named-pipe-ready.rs
│   ├── named-pipe.rs
│   ├── print_each_packet.rs
│   ├── proxy.rs
│   ├── tinydb.rs
│   ├── tinyhttp.rs
│   ├── udp-client.rs
│   └── udp-codec.rs
├── netlify.toml
├── spellcheck.dic
├── spellcheck.toml
├── stress-test/
│   ├── Cargo.toml
│   └── examples/
│       └── simple_echo_tcp.rs
├── target-specs/
│   ├── README.md
│   └── i686-unknown-linux-gnu.json
├── tests-build/
│   ├── Cargo.toml
│   ├── README.md
│   ├── src/
│   │   └── lib.rs
│   └── tests/
│       ├── fail/
│       │   ├── macros_core_no_default.rs
│       │   ├── macros_core_no_default.stderr
│       │   ├── macros_dead_code.rs
│       │   ├── macros_dead_code.stderr
│       │   ├── macros_invalid_input.rs
│       │   ├── macros_invalid_input.stderr
│       │   ├── macros_join.rs
│       │   ├── macros_join.stderr
│       │   ├── macros_try_join.rs
│       │   ├── macros_try_join.stderr
│       │   ├── macros_type_mismatch.rs
│       │   └── macros_type_mismatch.stderr
│       ├── macros.rs
│       ├── macros_clippy.rs
│       └── pass/
│           ├── forward_args_and_output.rs
│           ├── impl_trait.rs
│           ├── macros_main_loop.rs
│           ├── macros_main_return.rs
│           └── use_builder_outer.rs
├── tests-integration/
│   ├── Cargo.toml
│   ├── README.md
│   ├── src/
│   │   ├── bin/
│   │   │   ├── test-cat.rs
│   │   │   ├── test-mem.rs
│   │   │   └── test-process-signal.rs
│   │   └── lib.rs
│   └── tests/
│       ├── macros_main.rs
│       ├── macros_pin.rs
│       ├── macros_select.rs
│       ├── process_stdio.rs
│       └── rt_yield.rs
├── tokio/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE
│   ├── README.md
│   ├── docs/
│   │   └── reactor-refactor.md
│   ├── fuzz/
│   │   ├── .gitignore
│   │   ├── Cargo.toml
│   │   └── fuzz_targets/
│   │       └── fuzz_linked_list.rs
│   ├── src/
│   │   ├── blocking.rs
│   │   ├── doc/
│   │   │   ├── mod.rs
│   │   │   └── os.rs
│   │   ├── fs/
│   │   │   ├── canonicalize.rs
│   │   │   ├── copy.rs
│   │   │   ├── create_dir.rs
│   │   │   ├── create_dir_all.rs
│   │   │   ├── dir_builder.rs
│   │   │   ├── file/
│   │   │   │   └── tests.rs
│   │   │   ├── file.rs
│   │   │   ├── hard_link.rs
│   │   │   ├── metadata.rs
│   │   │   ├── mocks.rs
│   │   │   ├── mod.rs
│   │   │   ├── open_options/
│   │   │   │   ├── mock_open_options.rs
│   │   │   │   └── uring_open_options.rs
│   │   │   ├── open_options.rs
│   │   │   ├── read.rs
│   │   │   ├── read_dir.rs
│   │   │   ├── read_link.rs
│   │   │   ├── read_to_string.rs
│   │   │   ├── read_uring.rs
│   │   │   ├── remove_dir.rs
│   │   │   ├── remove_dir_all.rs
│   │   │   ├── remove_file.rs
│   │   │   ├── rename.rs
│   │   │   ├── set_permissions.rs
│   │   │   ├── symlink.rs
│   │   │   ├── symlink_dir.rs
│   │   │   ├── symlink_file.rs
│   │   │   ├── symlink_metadata.rs
│   │   │   ├── try_exists.rs
│   │   │   └── write.rs
│   │   ├── future/
│   │   │   ├── block_on.rs
│   │   │   ├── maybe_done.rs
│   │   │   ├── mod.rs
│   │   │   ├── trace.rs
│   │   │   └── try_join.rs
│   │   ├── fuzz.rs
│   │   ├── io/
│   │   │   ├── async_buf_read.rs
│   │   │   ├── async_fd.rs
│   │   │   ├── async_read.rs
│   │   │   ├── async_seek.rs
│   │   │   ├── async_write.rs
│   │   │   ├── blocking.rs
│   │   │   ├── bsd/
│   │   │   │   └── poll_aio.rs
│   │   │   ├── interest.rs
│   │   │   ├── join.rs
│   │   │   ├── mod.rs
│   │   │   ├── poll_evented.rs
│   │   │   ├── read_buf.rs
│   │   │   ├── ready.rs
│   │   │   ├── seek.rs
│   │   │   ├── split.rs
│   │   │   ├── stderr.rs
│   │   │   ├── stdin.rs
│   │   │   ├── stdio_common.rs
│   │   │   ├── stdout.rs
│   │   │   ├── uring/
│   │   │   │   ├── mod.rs
│   │   │   │   ├── open.rs
│   │   │   │   ├── read.rs
│   │   │   │   ├── utils.rs
│   │   │   │   └── write.rs
│   │   │   └── util/
│   │   │       ├── async_buf_read_ext.rs
│   │   │       ├── async_read_ext.rs
│   │   │       ├── async_seek_ext.rs
│   │   │       ├── async_write_ext.rs
│   │   │       ├── buf_reader.rs
│   │   │       ├── buf_stream.rs
│   │   │       ├── buf_writer.rs
│   │   │       ├── chain.rs
│   │   │       ├── copy.rs
│   │   │       ├── copy_bidirectional.rs
│   │   │       ├── copy_buf.rs
│   │   │       ├── empty.rs
│   │   │       ├── fill_buf.rs
│   │   │       ├── flush.rs
│   │   │       ├── lines.rs
│   │   │       ├── mem.rs
│   │   │       ├── mod.rs
│   │   │       ├── read.rs
│   │   │       ├── read_buf.rs
│   │   │       ├── read_exact.rs
│   │   │       ├── read_int.rs
│   │   │       ├── read_line.rs
│   │   │       ├── read_to_end.rs
│   │   │       ├── read_to_string.rs
│   │   │       ├── read_until.rs
│   │   │       ├── repeat.rs
│   │   │       ├── shutdown.rs
│   │   │       ├── sink.rs
│   │   │       ├── split.rs
│   │   │       ├── take.rs
│   │   │       ├── vec_with_initialized.rs
│   │   │       ├── write.rs
│   │   │       ├── write_all.rs
│   │   │       ├── write_all_buf.rs
│   │   │       ├── write_buf.rs
│   │   │       ├── write_int.rs
│   │   │       └── write_vectored.rs
│   │   ├── lib.rs
│   │   ├── loom/
│   │   │   ├── mocked.rs
│   │   │   ├── mod.rs
│   │   │   └── std/
│   │   │       ├── atomic_u16.rs
│   │   │       ├── atomic_u32.rs
│   │   │       ├── atomic_u64.rs
│   │   │       ├── atomic_u64_as_mutex.rs
│   │   │       ├── atomic_u64_native.rs
│   │   │       ├── atomic_u64_static_const_new.rs
│   │   │       ├── atomic_u64_static_once_cell.rs
│   │   │       ├── atomic_usize.rs
│   │   │       ├── barrier.rs
│   │   │       ├── mod.rs
│   │   │       ├── mutex.rs
│   │   │       ├── parking_lot.rs
│   │   │       ├── rwlock.rs
│   │   │       └── unsafe_cell.rs
│   │   ├── macros/
│   │   │   ├── addr_of.rs
│   │   │   ├── cfg.rs
│   │   │   ├── join.rs
│   │   │   ├── loom.rs
│   │   │   ├── mod.rs
│   │   │   ├── pin.rs
│   │   │   ├── select.rs
│   │   │   ├── support.rs
│   │   │   ├── thread_local.rs
│   │   │   ├── trace.rs
│   │   │   └── try_join.rs
│   │   ├── net/
│   │   │   ├── addr.rs
│   │   │   ├── lookup_host.rs
│   │   │   ├── mod.rs
│   │   │   ├── tcp/
│   │   │   │   ├── listener.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── socket.rs
│   │   │   │   ├── split.rs
│   │   │   │   ├── split_owned.rs
│   │   │   │   └── stream.rs
│   │   │   ├── udp.rs
│   │   │   ├── unix/
│   │   │   │   ├── datagram/
│   │   │   │   │   ├── mod.rs
│   │   │   │   │   └── socket.rs
│   │   │   │   ├── listener.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── pipe.rs
│   │   │   │   ├── socket.rs
│   │   │   │   ├── socketaddr.rs
│   │   │   │   ├── split.rs
│   │   │   │   ├── split_owned.rs
│   │   │   │   ├── stream.rs
│   │   │   │   └── ucred.rs
│   │   │   └── windows/
│   │   │       ├── mod.rs
│   │   │       └── named_pipe.rs
│   │   ├── process/
│   │   │   ├── kill.rs
│   │   │   ├── mod.rs
│   │   │   ├── unix/
│   │   │   │   ├── mod.rs
│   │   │   │   ├── orphan.rs
│   │   │   │   ├── pidfd_reaper.rs
│   │   │   │   └── reap.rs
│   │   │   └── windows.rs
│   │   ├── runtime/
│   │   │   ├── blocking/
│   │   │   │   ├── mod.rs
│   │   │   │   ├── pool.rs
│   │   │   │   ├── schedule.rs
│   │   │   │   ├── shutdown.rs
│   │   │   │   └── task.rs
│   │   │   ├── builder.rs
│   │   │   ├── config.rs
│   │   │   ├── context/
│   │   │   │   ├── blocking.rs
│   │   │   │   ├── current.rs
│   │   │   │   ├── runtime.rs
│   │   │   │   ├── runtime_mt.rs
│   │   │   │   └── scoped.rs
│   │   │   ├── context.rs
│   │   │   ├── driver/
│   │   │   │   └── op.rs
│   │   │   ├── driver.rs
│   │   │   ├── dump.rs
│   │   │   ├── handle.rs
│   │   │   ├── id.rs
│   │   │   ├── io/
│   │   │   │   ├── driver/
│   │   │   │   │   ├── signal.rs
│   │   │   │   │   └── uring.rs
│   │   │   │   ├── driver.rs
│   │   │   │   ├── metrics.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── registration.rs
│   │   │   │   ├── registration_set.rs
│   │   │   │   └── scheduled_io.rs
│   │   │   ├── local_runtime/
│   │   │   │   ├── mod.rs
│   │   │   │   ├── options.rs
│   │   │   │   └── runtime.rs
│   │   │   ├── metrics/
│   │   │   │   ├── batch.rs
│   │   │   │   ├── histogram/
│   │   │   │   │   └── h2_histogram.rs
│   │   │   │   ├── histogram.rs
│   │   │   │   ├── io.rs
│   │   │   │   ├── mock.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── runtime.rs
│   │   │   │   ├── scheduler.rs
│   │   │   │   └── worker.rs
│   │   │   ├── mod.rs
│   │   │   ├── park.rs
│   │   │   ├── process.rs
│   │   │   ├── runtime.rs
│   │   │   ├── scheduler/
│   │   │   │   ├── block_in_place.rs
│   │   │   │   ├── current_thread/
│   │   │   │   │   └── mod.rs
│   │   │   │   ├── defer.rs
│   │   │   │   ├── inject/
│   │   │   │   │   ├── metrics.rs
│   │   │   │   │   ├── pop.rs
│   │   │   │   │   ├── rt_multi_thread.rs
│   │   │   │   │   ├── shared.rs
│   │   │   │   │   └── synced.rs
│   │   │   │   ├── inject.rs
│   │   │   │   ├── lock.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── multi_thread/
│   │   │   │   │   ├── counters.rs
│   │   │   │   │   ├── handle/
│   │   │   │   │   │   ├── metrics.rs
│   │   │   │   │   │   └── taskdump.rs
│   │   │   │   │   ├── handle.rs
│   │   │   │   │   ├── idle.rs
│   │   │   │   │   ├── mod.rs
│   │   │   │   │   ├── overflow.rs
│   │   │   │   │   ├── park.rs
│   │   │   │   │   ├── queue.rs
│   │   │   │   │   ├── stats.rs
│   │   │   │   │   ├── trace.rs
│   │   │   │   │   ├── trace_mock.rs
│   │   │   │   │   ├── worker/
│   │   │   │   │   │   ├── metrics.rs
│   │   │   │   │   │   ├── taskdump.rs
│   │   │   │   │   │   └── taskdump_mock.rs
│   │   │   │   │   └── worker.rs
│   │   │   │   └── util/
│   │   │   │       ├── mod.rs
│   │   │   │       └── time_alt.rs
│   │   │   ├── signal/
│   │   │   │   └── mod.rs
│   │   │   ├── task/
│   │   │   │   ├── abort.rs
│   │   │   │   ├── core.rs
│   │   │   │   ├── error.rs
│   │   │   │   ├── harness.rs
│   │   │   │   ├── id.rs
│   │   │   │   ├── join.rs
│   │   │   │   ├── list.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── raw.rs
│   │   │   │   ├── state.rs
│   │   │   │   ├── trace/
│   │   │   │   │   ├── mod.rs
│   │   │   │   │   ├── symbol.rs
│   │   │   │   │   └── tree.rs
│   │   │   │   └── waker.rs
│   │   │   ├── task_hooks.rs
│   │   │   ├── tests/
│   │   │   │   ├── inject.rs
│   │   │   │   ├── loom_blocking.rs
│   │   │   │   ├── loom_current_thread/
│   │   │   │   │   └── yield_now.rs
│   │   │   │   ├── loom_current_thread.rs
│   │   │   │   ├── loom_join_set.rs
│   │   │   │   ├── loom_local.rs
│   │   │   │   ├── loom_multi_thread/
│   │   │   │   │   ├── queue.rs
│   │   │   │   │   ├── shutdown.rs
│   │   │   │   │   └── yield_now.rs
│   │   │   │   ├── loom_multi_thread.rs
│   │   │   │   ├── loom_oneshot.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── queue.rs
│   │   │   │   ├── task.rs
│   │   │   │   └── task_combinations.rs
│   │   │   ├── thread_id.rs
│   │   │   ├── time/
│   │   │   │   ├── entry.rs
│   │   │   │   ├── handle.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── source.rs
│   │   │   │   ├── tests/
│   │   │   │   │   └── mod.rs
│   │   │   │   └── wheel/
│   │   │   │       ├── level.rs
│   │   │   │       └── mod.rs
│   │   │   └── time_alt/
│   │   │       ├── cancellation_queue/
│   │   │       │   └── tests.rs
│   │   │       ├── cancellation_queue.rs
│   │   │       ├── context.rs
│   │   │       ├── entry.rs
│   │   │       ├── mod.rs
│   │   │       ├── registration_queue/
│   │   │       │   └── tests.rs
│   │   │       ├── registration_queue.rs
│   │   │       ├── tests.rs
│   │   │       ├── timer.rs
│   │   │       ├── wake_queue/
│   │   │       │   └── tests.rs
│   │   │       ├── wake_queue.rs
│   │   │       └── wheel/
│   │   │           ├── level.rs
│   │   │           └── mod.rs
│   │   ├── signal/
│   │   │   ├── ctrl_c.rs
│   │   │   ├── mod.rs
│   │   │   ├── registry.rs
│   │   │   ├── reusable_box.rs
│   │   │   ├── unix.rs
│   │   │   ├── windows/
│   │   │   │   ├── stub.rs
│   │   │   │   └── sys.rs
│   │   │   └── windows.rs
│   │   ├── sync/
│   │   │   ├── barrier.rs
│   │   │   ├── batch_semaphore.rs
│   │   │   ├── broadcast.rs
│   │   │   ├── mod.rs
│   │   │   ├── mpsc/
│   │   │   │   ├── block.rs
│   │   │   │   ├── bounded.rs
│   │   │   │   ├── chan.rs
│   │   │   │   ├── error.rs
│   │   │   │   ├── list.rs
│   │   │   │   ├── mod.rs
│   │   │   │   └── unbounded.rs
│   │   │   ├── mutex.rs
│   │   │   ├── notify.rs
│   │   │   ├── once_cell.rs
│   │   │   ├── oneshot.rs
│   │   │   ├── rwlock/
│   │   │   │   ├── owned_read_guard.rs
│   │   │   │   ├── owned_write_guard.rs
│   │   │   │   ├── owned_write_guard_mapped.rs
│   │   │   │   ├── read_guard.rs
│   │   │   │   ├── write_guard.rs
│   │   │   │   └── write_guard_mapped.rs
│   │   │   ├── rwlock.rs
│   │   │   ├── semaphore.rs
│   │   │   ├── set_once.rs
│   │   │   ├── task/
│   │   │   │   ├── atomic_waker.rs
│   │   │   │   └── mod.rs
│   │   │   ├── tests/
│   │   │   │   ├── atomic_waker.rs
│   │   │   │   ├── loom_atomic_waker.rs
│   │   │   │   ├── loom_broadcast.rs
│   │   │   │   ├── loom_list.rs
│   │   │   │   ├── loom_mpsc.rs
│   │   │   │   ├── loom_notify.rs
│   │   │   │   ├── loom_oneshot.rs
│   │   │   │   ├── loom_rwlock.rs
│   │   │   │   ├── loom_semaphore_batch.rs
│   │   │   │   ├── loom_set_once.rs
│   │   │   │   ├── loom_watch.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── notify.rs
│   │   │   │   └── semaphore_batch.rs
│   │   │   └── watch.rs
│   │   ├── task/
│   │   │   ├── blocking.rs
│   │   │   ├── builder.rs
│   │   │   ├── coop/
│   │   │   │   ├── consume_budget.rs
│   │   │   │   ├── mod.rs
│   │   │   │   └── unconstrained.rs
│   │   │   ├── join_set.rs
│   │   │   ├── local.rs
│   │   │   ├── mod.rs
│   │   │   ├── spawn.rs
│   │   │   ├── task_local.rs
│   │   │   └── yield_now.rs
│   │   ├── time/
│   │   │   ├── clock.rs
│   │   │   ├── error.rs
│   │   │   ├── instant.rs
│   │   │   ├── interval.rs
│   │   │   ├── mod.rs
│   │   │   ├── sleep.rs
│   │   │   └── timeout.rs
│   │   └── util/
│   │       ├── as_ref.rs
│   │       ├── atomic_cell.rs
│   │       ├── bit.rs
│   │       ├── blocking_check.rs
│   │       ├── cacheline.rs
│   │       ├── error.rs
│   │       ├── idle_notified_set.rs
│   │       ├── linked_list.rs
│   │       ├── markers.rs
│   │       ├── memchr.rs
│   │       ├── metric_atomics.rs
│   │       ├── mod.rs
│   │       ├── ptr_expose.rs
│   │       ├── rand/
│   │       │   ├── rt.rs
│   │       │   └── rt_unstable.rs
│   │       ├── rand.rs
│   │       ├── rc_cell.rs
│   │       ├── sharded_list.rs
│   │       ├── sync_wrapper.rs
│   │       ├── trace.rs
│   │       ├── try_lock.rs
│   │       ├── typeid.rs
│   │       ├── wake.rs
│   │       └── wake_list.rs
│   └── tests/
│       ├── _require_full.rs
│       ├── async_send_sync.rs
│       ├── buffered.rs
│       ├── coop_budget.rs
│       ├── dump.rs
│       ├── duplex_stream.rs
│       ├── fs.rs
│       ├── fs_canonicalize_dir.rs
│       ├── fs_copy.rs
│       ├── fs_dir.rs
│       ├── fs_file.rs
│       ├── fs_link.rs
│       ├── fs_open_options.rs
│       ├── fs_open_options_windows.rs
│       ├── fs_remove_dir_all.rs
│       ├── fs_remove_file.rs
│       ├── fs_rename.rs
│       ├── fs_symlink_dir_windows.rs
│       ├── fs_symlink_file_windows.rs
│       ├── fs_try_exists.rs
│       ├── fs_uring.rs
│       ├── fs_uring_read.rs
│       ├── fs_write.rs
│       ├── io_async_fd.rs
│       ├── io_async_fd_memory_leak.rs
│       ├── io_async_read.rs
│       ├── io_buf_reader.rs
│       ├── io_buf_writer.rs
│       ├── io_chain.rs
│       ├── io_copy.rs
│       ├── io_copy_bidirectional.rs
│       ├── io_driver.rs
│       ├── io_driver_drop.rs
│       ├── io_fill_buf.rs
│       ├── io_join.rs
│       ├── io_lines.rs
│       ├── io_mem_stream.rs
│       ├── io_panic.rs
│       ├── io_poll_aio.rs
│       ├── io_read.rs
│       ├── io_read_buf.rs
│       ├── io_read_exact.rs
│       ├── io_read_line.rs
│       ├── io_read_to_end.rs
│       ├── io_read_to_string.rs
│       ├── io_read_until.rs
│       ├── io_repeat.rs
│       ├── io_sink.rs
│       ├── io_split.rs
│       ├── io_take.rs
│       ├── io_util_empty.rs
│       ├── io_write.rs
│       ├── io_write_all.rs
│       ├── io_write_all_buf.rs
│       ├── io_write_buf.rs
│       ├── io_write_int.rs
│       ├── join_handle_panic.rs
│       ├── macros_join.rs
│       ├── macros_pin.rs
│       ├── macros_rename_test.rs
│       ├── macros_select.rs
│       ├── macros_test.rs
│       ├── macros_try_join.rs
│       ├── net_bind_resource.rs
│       ├── net_lookup_host.rs
│       ├── net_named_pipe.rs
│       ├── net_panic.rs
│       ├── net_quickack.rs
│       ├── net_unix_pipe.rs
│       ├── no_rt.rs
│       ├── process_arg0.rs
│       ├── process_change_of_runtime.rs
│       ├── process_issue_2174.rs
│       ├── process_issue_42.rs
│       ├── process_issue_7144.rs
│       ├── process_kill_after_wait.rs
│       ├── process_kill_on_drop.rs
│       ├── process_raw_handle.rs
│       ├── process_smoke.rs
│       ├── rt_basic.rs
│       ├── rt_common.rs
│       ├── rt_common_before_park.rs
│       ├── rt_handle.rs
│       ├── rt_handle_block_on.rs
│       ├── rt_local.rs
│       ├── rt_metrics.rs
│       ├── rt_panic.rs
│       ├── rt_poll_callbacks.rs
│       ├── rt_shutdown_err.rs
│       ├── rt_threaded.rs
│       ├── rt_time_start_paused.rs
│       ├── rt_unstable_metrics.rs
│       ├── rt_worker_index.rs
│       ├── signal_ctrl_c.rs
│       ├── signal_drop_recv.rs
│       ├── signal_drop_rt.rs
│       ├── signal_drop_signal.rs
│       ├── signal_info.rs
│       ├── signal_multi_rt.rs
│       ├── signal_no_rt.rs
│       ├── signal_notify_both.rs
│       ├── signal_panic.rs
│       ├── signal_realtime.rs
│       ├── signal_twice.rs
│       ├── signal_usr1.rs
│       ├── support/
│       │   ├── io_vec.rs
│       │   ├── leaked_buffers.rs
│       │   ├── mpsc_stream.rs
│       │   ├── panic.rs
│       │   └── signal.rs
│       ├── sync_barrier.rs
│       ├── sync_broadcast.rs
│       ├── sync_broadcast_weak.rs
│       ├── sync_errors.rs
│       ├── sync_mpsc.rs
│       ├── sync_mpsc_weak.rs
│       ├── sync_mutex.rs
│       ├── sync_mutex_owned.rs
│       ├── sync_notify.rs
│       ├── sync_notify_owned.rs
│       ├── sync_once_cell.rs
│       ├── sync_oneshot.rs
│       ├── sync_panic.rs
│       ├── sync_rwlock.rs
│       ├── sync_semaphore.rs
│       ├── sync_semaphore_owned.rs
│       ├── sync_set_once.rs
│       ├── sync_watch.rs
│       ├── task_abort.rs
│       ├── task_blocking.rs
│       ├── task_builder.rs
│       ├── task_hooks.rs
│       ├── task_id.rs
│       ├── task_join_set.rs
│       ├── task_local.rs
│       ├── task_local_set.rs
│       ├── task_panic.rs
│       ├── task_trace_self.rs
│       ├── task_yield_now.rs
│       ├── tcp_accept.rs
│       ├── tcp_connect.rs
│       ├── tcp_echo.rs
│       ├── tcp_into_split.rs
│       ├── tcp_into_std.rs
│       ├── tcp_peek.rs
│       ├── tcp_shutdown.rs
│       ├── tcp_socket.rs
│       ├── tcp_split.rs
│       ├── tcp_stream.rs
│       ├── test_clock.rs
│       ├── time_alt.rs
│       ├── time_interval.rs
│       ├── time_panic.rs
│       ├── time_pause.rs
│       ├── time_rt.rs
│       ├── time_sleep.rs
│       ├── time_timeout.rs
│       ├── time_wasm.rs
│       ├── tracing_sync.rs
│       ├── tracing_task.rs
│       ├── tracing_time.rs
│       ├── udp.rs
│       ├── uds_cred.rs
│       ├── uds_datagram.rs
│       ├── uds_socket.rs
│       ├── uds_split.rs
│       ├── uds_stream.rs
│       └── unwindsafe.rs
├── tokio-macros/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE
│   ├── README.md
│   └── src/
│       ├── entry.rs
│       ├── lib.rs
│       └── select.rs
├── tokio-stream/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE
│   ├── README.md
│   ├── fuzz/
│   │   ├── .gitignore
│   │   ├── Cargo.toml
│   │   └── fuzz_targets/
│   │       └── fuzz_stream_map.rs
│   ├── src/
│   │   ├── empty.rs
│   │   ├── iter.rs
│   │   ├── lib.rs
│   │   ├── macros.rs
│   │   ├── once.rs
│   │   ├── pending.rs
│   │   ├── stream_close.rs
│   │   ├── stream_ext/
│   │   │   ├── all.rs
│   │   │   ├── any.rs
│   │   │   ├── chain.rs
│   │   │   ├── chunks_timeout.rs
│   │   │   ├── collect.rs
│   │   │   ├── filter.rs
│   │   │   ├── filter_map.rs
│   │   │   ├── fold.rs
│   │   │   ├── fuse.rs
│   │   │   ├── map.rs
│   │   │   ├── map_while.rs
│   │   │   ├── merge.rs
│   │   │   ├── next.rs
│   │   │   ├── peekable.rs
│   │   │   ├── skip.rs
│   │   │   ├── skip_while.rs
│   │   │   ├── take.rs
│   │   │   ├── take_while.rs
│   │   │   ├── then.rs
│   │   │   ├── throttle.rs
│   │   │   ├── timeout.rs
│   │   │   ├── timeout_repeating.rs
│   │   │   └── try_next.rs
│   │   ├── stream_ext.rs
│   │   ├── stream_map.rs
│   │   ├── wrappers/
│   │   │   ├── broadcast.rs
│   │   │   ├── interval.rs
│   │   │   ├── lines.rs
│   │   │   ├── mpsc_bounded.rs
│   │   │   ├── mpsc_unbounded.rs
│   │   │   ├── read_dir.rs
│   │   │   ├── signal_unix.rs
│   │   │   ├── signal_windows.rs
│   │   │   ├── split.rs
│   │   │   ├── tcp_listener.rs
│   │   │   ├── unix_listener.rs
│   │   │   └── watch.rs
│   │   └── wrappers.rs
│   └── tests/
│       ├── async_send_sync.rs
│       ├── chunks_timeout.rs
│       ├── mpsc_bounded_stream.rs
│       ├── mpsc_unbounded_stream.rs
│       ├── stream_chain.rs
│       ├── stream_chunks_timeout.rs
│       ├── stream_close.rs
│       ├── stream_collect.rs
│       ├── stream_empty.rs
│       ├── stream_fuse.rs
│       ├── stream_iter.rs
│       ├── stream_merge.rs
│       ├── stream_once.rs
│       ├── stream_panic.rs
│       ├── stream_pending.rs
│       ├── stream_stream_map.rs
│       ├── stream_timeout.rs
│       ├── support/
│       │   └── mpsc.rs
│       ├── time_throttle.rs
│       └── watch.rs
├── tokio-test/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE
│   ├── README.md
│   ├── src/
│   │   ├── io.rs
│   │   ├── lib.rs
│   │   ├── macros.rs
│   │   ├── stream_mock.rs
│   │   └── task.rs
│   └── tests/
│       ├── block_on.rs
│       ├── io.rs
│       ├── macros.rs
│       ├── stream_mock.rs
│       └── task.rs
└── tokio-util/
    ├── CHANGELOG.md
    ├── Cargo.toml
    ├── LICENSE
    ├── README.md
    ├── src/
    │   ├── cfg.rs
    │   ├── codec/
    │   │   ├── any_delimiter_codec.rs
    │   │   ├── bytes_codec.rs
    │   │   ├── decoder.rs
    │   │   ├── encoder.rs
    │   │   ├── framed.rs
    │   │   ├── framed_impl.rs
    │   │   ├── framed_read.rs
    │   │   ├── framed_write.rs
    │   │   ├── length_delimited.rs
    │   │   ├── lines_codec.rs
    │   │   └── mod.rs
    │   ├── compat.rs
    │   ├── context.rs
    │   ├── either.rs
    │   ├── future/
    │   │   └── with_cancellation_token.rs
    │   ├── future.rs
    │   ├── io/
    │   │   ├── copy_to_bytes.rs
    │   │   ├── inspect.rs
    │   │   ├── mod.rs
    │   │   ├── read_arc.rs
    │   │   ├── read_buf.rs
    │   │   ├── reader_stream.rs
    │   │   ├── simplex.rs
    │   │   ├── sink_writer.rs
    │   │   ├── stream_reader.rs
    │   │   ├── sync_bridge.rs
    │   │   └── write_all_vectored.rs
    │   ├── lib.rs
    │   ├── loom.rs
    │   ├── net/
    │   │   ├── mod.rs
    │   │   └── unix/
    │   │       └── mod.rs
    │   ├── sync/
    │   │   ├── cancellation_token/
    │   │   │   ├── guard.rs
    │   │   │   ├── guard_ref.rs
    │   │   │   └── tree_node.rs
    │   │   ├── cancellation_token.rs
    │   │   ├── mod.rs
    │   │   ├── mpsc.rs
    │   │   ├── poll_semaphore.rs
    │   │   ├── reusable_box.rs
    │   │   └── tests/
    │   │       ├── loom_cancellation_token.rs
    │   │       └── mod.rs
    │   ├── task/
    │   │   ├── abort_on_drop.rs
    │   │   ├── join_map.rs
    │   │   ├── join_queue.rs
    │   │   ├── mod.rs
    │   │   ├── spawn_pinned.rs
    │   │   └── task_tracker.rs
    │   ├── time/
    │   │   ├── delay_queue.rs
    │   │   ├── mod.rs
    │   │   └── wheel/
    │   │       ├── level.rs
    │   │       ├── mod.rs
    │   │       └── stack.rs
    │   ├── tracing.rs
    │   ├── udp/
    │   │   ├── frame.rs
    │   │   └── mod.rs
    │   └── util/
    │       ├── maybe_dangling.rs
    │       ├── mod.rs
    │       └── poll_buf.rs
    └── tests/
        ├── _require_full.rs
        ├── abort_on_drop.rs
        ├── codecs.rs
        ├── compat.rs
        ├── context.rs
        ├── framed.rs
        ├── framed_read.rs
        ├── framed_stream.rs
        ├── framed_write.rs
        ├── future.rs
        ├── io_inspect.rs
        ├── io_reader_stream.rs
        ├── io_simplex.rs
        ├── io_sink_writer.rs
        ├── io_stream_reader.rs
        ├── io_sync_bridge.rs
        ├── io_write_all_vectored.rs
        ├── length_delimited.rs
        ├── mpsc.rs
        ├── panic.rs
        ├── poll_semaphore.rs
        ├── reusable_box.rs
        ├── spawn_pinned.rs
        ├── sync_cancellation_token.rs
        ├── task_join_map.rs
        ├── task_join_queue.rs
        ├── task_tracker.rs
        ├── time_delay_queue.rs
        └── udp.rs

================================================
FILE CONTENTS
================================================

================================================
FILE: .cirrus.yml
================================================
only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'master' || $CIRRUS_BRANCH =~ 'tokio-.*')
auto_cancellation: $CIRRUS_BRANCH != 'master' && $CIRRUS_BRANCH !=~ 'tokio-.*'
freebsd_instance:
  image_family: freebsd-14-3
env:
  RUST_STABLE: stable
  RUST_NIGHTLY: nightly-2025-10-12
  RUSTFLAGS: -D warnings
  # This excludes unstable features like io_uring, which require '--cfg tokio_unstable'.
  TOKIO_STABLE_FEATURES: full,test-util

# Test FreeBSD in a full VM on cirrus-ci.com.  Test the i686 target too, in the
# same VM.  The binary will be built in 32-bit mode, but will execute on a
# 64-bit kernel and in a 64-bit environment.  Our tests don't execute any of
# the system's binaries, so the environment shouldn't matter.
task:
  name: FreeBSD 64-bit
  setup_script:
    - pkg install -y bash ca_root_nss
    - curl https://sh.rustup.rs -sSf --output rustup.sh
    - sh rustup.sh -y --profile minimal --default-toolchain $RUST_STABLE
    - . $HOME/.cargo/env
    - |
      echo "~~~~ rustc --version ~~~~"
      rustc --version
  test_script:
    - . $HOME/.cargo/env
    - cargo test --workspace --features $TOKIO_STABLE_FEATURES
    # Free the disk space before the next build,
    # otherwise cirrus-ci complains about "No space left on device".
    - cargo clean
    # Enable all unstable features except `taskdump`, which is Linux-only.
    - |
      RUSTFLAGS="$RUSTFLAGS --cfg tokio_unstable" \
      RUSTDOCFLAGS="$RUSTDOCFLAGS --cfg tokio_unstable" \
        cargo test \
          --features $TOKIO_STABLE_FEATURES,io-uring,tracing

task:
  name: FreeBSD docs
  env:
    RUSTFLAGS: --cfg docsrs --cfg tokio_unstable
    RUSTDOCFLAGS: --cfg docsrs --cfg tokio_unstable -Dwarnings
  setup_script:
    - pkg install -y bash ca_root_nss
    - curl https://sh.rustup.rs -sSf --output rustup.sh
    - sh rustup.sh -y --profile minimal --default-toolchain $RUST_NIGHTLY
    - . $HOME/.cargo/env
    - |
      echo "~~~~ rustc --version ~~~~"
      rustc --version
  test_script:
    - . $HOME/.cargo/env
    # We use `--features $TOKIO_STABLE_FEATURES,io-uring,tracing` instead of
    # `--all-features` to exclude `taskdump`, which is Linux-only.
    - cargo doc --lib --no-deps --features $TOKIO_STABLE_FEATURES,io-uring,tracing --document-private-items

task:
  name: FreeBSD 32-bit
  setup_script:
    - pkg install -y bash ca_root_nss
    - curl https://sh.rustup.rs -sSf --output rustup.sh
    - sh rustup.sh -y --profile minimal --default-toolchain $RUST_STABLE
    - . $HOME/.cargo/env
    - rustup target add i686-unknown-freebsd
    - |
      echo "~~~~ rustc --version ~~~~"
      rustc --version
  test_script:
    - . $HOME/.cargo/env
    - cargo test --workspace --features $TOKIO_STABLE_FEATURES --target i686-unknown-freebsd


================================================
FILE: .github/FUNDING.yml
================================================
# These are supported funding model platforms

github: [tokio-rs]


================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: A-tokio, C-bug
assignees: ''

---

**Version**
List the versions of all `tokio` crates you are using. The easiest way to get
this information is using `cargo tree` subcommand:

`cargo tree | grep tokio`

**Platform**
The output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows)

**Description**
Enter your issue details here.
One way to structure the description:

[short summary of the bug]

I tried this code:

[code sample that causes the bug]

I expected to see this happen: [explanation]

Instead, this happened: [explanation]


================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
contact_links:
  - name: Question
    url: https://github.com/tokio-rs/tokio/discussions
    about: Questions about Tokio should be posted as a GitHub discussion.


================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: A-tokio, C-feature-request
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.


================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
<!--
Thank you for your Pull Request. Please provide a description above and review
the requirements below.

Bug fixes and new features should include tests.

Contributors guide: https://github.com/tokio-rs/tokio/blob/master/CONTRIBUTING.md

The contributors guide includes instructions for running rustfmt and building the
documentation, which requires special commands beyond `cargo fmt` and `cargo doc`.
-->

## Motivation

<!--
Explain the context and why you're making that change. What is the problem
you're trying to solve? In some cases there is not a problem and this can be
thought of as being the motivation for your change.
-->

## Solution

<!--
Summarize the solution and provide any necessary context needed to understand
the code change.
-->


================================================
FILE: .github/buildomat/README.md
================================================
# Buildomat illumos CI

This directory contains CI configurations for the [illumos] operating system.
Tokio's illumos CI jobs are run using [Buildomat], a CI system developed by
Oxide Computer, which supports illumos. See [the Buildomat README] for more
details.

## illumos-Specific CI Failures

If your pull request's CI build fails on illumos, and you aren't able to easily
reproduce the failure on other operating systems, don't worry! The
[tokio-rs/illumos] team is responsible for maintaining Tokio's illumos support,
and can be called on to assist contributors with illumos-specific issues. Please
feel free to tag @tokio-rs/illumos to ask for help resolving build failures on
illumos.

[illumos]: https://www.illumos.org/
[Buildomat]: https://github.com/oxidecomputer/buildomat
[the Buildomat README]: https://github.com/oxidecomputer/buildomat
[tokio-rs/illumos]: https://github.com/orgs/tokio-rs/teams/illumos


================================================
FILE: .github/buildomat/config.toml
================================================
# Repository-level Buildomat configuration.
# See: https://github.com/oxidecomputer/buildomat#per-repository-configuration

# Enable buildomat. This one should be self-explanatory.
enable = true
# Allow CI runs for PRs from users outside the `tokio-rs` organization. Our
# buildomat jobs don't touch any secrets/keys, so this should be fine.
org_only = false


================================================
FILE: .github/labeler.yml
================================================
R-loom-blocking:
- tokio/src/runtime/blocking/*
- tokio/src/runtime/blocking/**/*

R-loom-sync:
- tokio/src/sync/*
- tokio/src/sync/**/*

R-loom-time-driver:
- tokio/src/runtime/time/*
- tokio/src/runtime/time/**/*

R-loom-current-thread:
- tokio/src/runtime/scheduler/*
- tokio/src/runtime/scheduler/current_thread/*
- tokio/src/runtime/task/*
- tokio/src/runtime/task/**

R-loom-multi-thread:
- tokio/src/runtime/scheduler/*
- tokio/src/runtime/scheduler/multi_thread/*
- tokio/src/runtime/scheduler/multi_thread/**
- tokio/src/runtime/task/*
- tokio/src/runtime/task/**

R-loom-util:
- tokio-util/src/*
- tokio-util/src/**/*


================================================
FILE: .github/workflows/audit.yml
================================================
name: Security Audit

on:
  push:
    branches:
      - master
    paths:
      - '**/Cargo.toml'
  schedule:
    - cron: '0 2 * * *' # run at 2 AM UTC

permissions:
  contents: read

jobs:
  cargo-deny:
    permissions:
      checks: write
      contents: read
      issues: write
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v5
    - uses: EmbarkStudios/cargo-deny-action@v2


================================================
FILE: .github/workflows/ci.yml
================================================
on:
  push:
    branches: ["master", "tokio-*.x"]
  pull_request:
    branches: ["master", "tokio-*.x"]

name: CI

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
  cancel-in-progress: true

env:
  RUSTFLAGS: -Dwarnings
  RUST_BACKTRACE: 1
  RUSTUP_WINDOWS_PATH_ADD_BIN: 1
  # Change to specific Rust release to pin
  rust_stable: stable
  rust_nightly: nightly-2025-10-12
  # Pin a specific miri version
  rust_miri_nightly: nightly-2025-11-13
  rust_clippy: '1.88'
  # When updating this, also update:
  # - README.md
  # - tokio/README.md
  # - CONTRIBUTING.md
  # - tokio/Cargo.toml
  # - tokio-util/Cargo.toml
  # - tokio-test/Cargo.toml
  # - tokio-stream/Cargo.toml
  rust_min: '1.71'
  # This excludes unstable features like io_uring,
  # which require '--cfg tokio_unstable'.
  TOKIO_STABLE_FEATURES: "full,test-util"

defaults:
  run:
    shell: bash

permissions:
  contents: read

jobs:
  # Basic actions that must pass before we kick off more expensive tests.
  basics:
    name: basic checks
    runs-on: ubuntu-latest
    needs:
      - clippy
      - fmt
      - docs
      - minrust
    steps:
      - run: exit 0

  test-tokio-full:
    needs: basics
    name: test tokio full
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os:
          - windows-latest
          - ubuntu-latest
          - macos-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@stable
        with:
            toolchain: ${{ env.rust_stable }}
      - name: Install cargo-nextest
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-nextest

      - uses: Swatinem/rust-cache@v2

      # Run `tokio` with stable features. This excludes testing utilities which
      # can alter the runtime behavior of Tokio.
      - name: test tokio full
        run: |
          set -euxo pipefail
          cargo nextest run --features full
          cargo test --doc --features full
        working-directory: tokio

  test-workspace-all-features:
    needs: basics
    name: test all crates in the workspace with all features
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os:
          - windows-latest
          - ubuntu-latest
          - macos-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@stable
        with:
            toolchain: ${{ env.rust_stable }}
      - name: Install cargo-nextest
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-nextest

      - uses: Swatinem/rust-cache@v2

      - name: test --features ${{ env.TOKIO_STABLE_FEATURES }}
        run: |
          set -euxo pipefail
          cargo nextest run --workspace --features $TOKIO_STABLE_FEATURES
          # Removing workspace patches to run tests without path dependencies
          # (if not specified differently in the crate)
          perl -0 -i -pe 's/\[patch\.crates-io\].+\n\[/[/s' Cargo.toml
          cargo nextest run \
            --workspace \
            --exclude tokio \
            --exclude examples \
            --features $TOKIO_STABLE_FEATURES
          # Cargo nextest does not support doctest, so we run them separately
          # (see https://github.com/nextest-rs/nextest/issues/16)
          cargo test --doc --workspace --features $TOKIO_STABLE_FEATURES

  test-workspace-all-features-panic-abort:
    needs: basics
    name: test all crates in the workspace with all features and panic=abort
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os:
          - windows-latest
          - ubuntu-latest
          - macos-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_nightly }}
        uses: dtolnay/rust-toolchain@stable
        with:
            toolchain: ${{ env.rust_nightly }}
      - name: Install cargo-nextest
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-nextest

      - uses: Swatinem/rust-cache@v2

      - name: test --features ${{ env.TOKIO_STABLE_FEATURES }} panic=abort
        run: |
          set -euxo pipefail
          RUSTFLAGS="$RUSTFLAGS -C panic=abort -Zpanic-abort-tests" cargo nextest run \
            --workspace \
            --exclude tokio-macros \
            --exclude tests-build \
            --features $TOKIO_STABLE_FEATURES \
            --tests

  test-integration-tests-per-feature:
    needs: basics
    name: Run integration tests for each feature
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os:
          - windows-latest
          - ubuntu-latest
          - macos-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@stable
        with:
            toolchain: ${{ env.rust_stable }}
      - name: Install cargo-hack
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-hack

      - uses: Swatinem/rust-cache@v2

      # Run integration tests for each feature
      - name: test tests-integration --each-feature
        run: cargo hack test --each-feature
        working-directory: tests-integration

      # Run macro build tests
      - name: test tests-build --each-feature
        run: cargo hack test --each-feature
        working-directory: tests-build

      # Check benchmarks.
      - name: Check benches
        run: cargo check --benches
        working-directory: benches
        if: startsWith(matrix.os, 'ubuntu')

  test-parking_lot:
    # The parking_lot crate has a feature called send_guard which changes when
    # some of its types are Send. Tokio has some measures in place to prevent
    # this from affecting when Tokio types are Send, and this test exists to
    # ensure that those measures are working.
    #
    # This relies on the potentially affected Tokio type being listed in
    # `tokio/tokio/tests/async_send_sync.rs`.
    name: compile tests with parking lot send guards
    needs: basics
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@stable
        with:
            toolchain: ${{ env.rust_stable }}

      - name: Enable parking_lot send_guard feature
        # Inserts the line "plsend = ["parking_lot/send_guard"]" right after [features]
        run: sed -i '/\[features\]/a plsend = ["parking_lot/send_guard"]' tokio/Cargo.toml

      - uses: Swatinem/rust-cache@v2

      - name: Check tests --features ${{ env.TOKIO_STABLE_FEATURES }}
        run: |
          set -euxo pipefail
          cargo check --workspace --tests --features $TOKIO_STABLE_FEATURES
          # Removing the tokio workspace patch to run tests without path dependencies
          # (if not specified differently in the crate)
          perl -0 -i -pe 's/\[patch\.crates-io\].+\n\[/[/s' Cargo.toml
          cargo check --workspace --exclude tokio --tests --features $TOKIO_STABLE_FEATURES

  valgrind:
    name: valgrind
    needs: basics
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@stable
        with:
            toolchain: 1.82

      - name: Install Valgrind
        uses: taiki-e/install-action@valgrind

      - uses: Swatinem/rust-cache@v2
      # Compile tests
      - name: cargo build test-mem
        run: cargo build --features rt-net --bin test-mem
        working-directory: tests-integration

      # Run with valgrind
      - name: Run valgrind test-mem
        run: valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all --fair-sched=yes ./target/debug/test-mem

      # Compile tests
      - name: cargo build test-process-signal
        run: cargo build --features rt-process-signal --bin test-process-signal
        working-directory: tests-integration

      # Run with valgrind
      - name: Run valgrind test-process-signal
        run: valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all --fair-sched=yes ./target/debug/test-process-signal

  test-unstable:
    name: test tokio full --unstable
    needs: basics
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - { os: windows-latest, extra_features: "" }
          - { os: ubuntu-latest, extra_features: "" }
          # only Linux supports io_uring
          - { os: ubuntu-latest, extra_features: io-uring }
          - { os: macos-latest, extra_features: "" }
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@stable
        with:
            toolchain: ${{ env.rust_stable }}

      - name: Install cargo-nextest
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-nextest

      - uses: Swatinem/rust-cache@v2
      # Run `tokio` with "unstable" cfg flag.
      - name: test tokio full --cfg unstable
        run: |
          set -euxo pipefail
          cargo nextest run --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }}
          cargo test --doc --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }}
        working-directory: tokio
        env:
          RUSTFLAGS: --cfg tokio_unstable -Dwarnings
          # in order to run doctests for unstable features, we must also pass
          # the unstable cfg to RustDoc
          RUSTDOCFLAGS: --cfg tokio_unstable

  test-unstable-taskdump:
    name: test tokio full --unstable --taskdump
    needs: basics
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - os: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@stable
        with:
            toolchain: ${{ env.rust_stable }}

      - name: Install cargo-nextest
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-nextest

      - uses: Swatinem/rust-cache@v2
      # Run `tokio` with "unstable" and "taskdump" cfg flags.
      - name: test tokio full --cfg unstable --cfg taskdump
        run: |
          set -euxo pipefail
          cargo nextest run --features $TOKIO_STABLE_FEATURES,taskdump
          cargo test --doc --features $TOKIO_STABLE_FEATURES
        working-directory: tokio
        env:
          RUSTFLAGS: --cfg tokio_unstable -Dwarnings
          # in order to run doctests for unstable features, we must also pass
          # the unstable cfg to RustDoc
          RUSTDOCFLAGS: --cfg tokio_unstable

  check-unstable-mt-counters:
    name: check tokio full --internal-mt-counters
    needs: basics
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - os: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@stable
        with:
            toolchain: ${{ env.rust_stable }}
      - name: Install cargo-nextest
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-nextest
      - uses: Swatinem/rust-cache@v2
      # Since the internal-mt-counters feature is only for debugging purposes,
      # we can enable all features including unstable.
      - name: check tokio full --cfg unstable --cfg internal-mt-counters
        run: |
          set -euxo pipefail
          cargo nextest run --all-features
          cargo test --doc --all-features
        working-directory: tokio
        env:
          RUSTFLAGS: --cfg tokio_unstable --cfg tokio_internal_mt_counters -Dwarnings
          # in order to run doctests for unstable features, we must also pass
          # the unstable cfg to RustDoc
          RUSTDOCFLAGS: --cfg tokio_unstable --cfg tokio_internal_mt_counters

  miri-lib:
    name: miri-lib
    needs: basics
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_miri_nightly }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_miri_nightly }}
          components: miri
      - name: Install cargo-nextest
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-nextest
      - uses: Swatinem/rust-cache@v2
      - name: miri
        run: |
          cargo miri nextest run --features full --lib --no-fail-fast
        working-directory: tokio
        env:
          MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance

  miri-test:
    name: miri-test
    needs: basics
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_miri_nightly }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_miri_nightly }}
          components: miri
      - name: Install cargo-nextest
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-nextest
      - uses: Swatinem/rust-cache@v2
      - name: miri
        run: |
          cargo miri nextest run --features full --test '*' --no-fail-fast
        working-directory: tokio
        env:
          MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance

  miri-doc:
    name: miri-doc
    needs: basics
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_miri_nightly }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_miri_nightly }}
          components: miri
      - uses: Swatinem/rust-cache@v2
      - name: miri-doc-test
        run: |
          cargo miri test --doc --features $TOKIO_STABLE_FEATURES --no-fail-fast
        working-directory: tokio
        env:
          MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance

  asan:
    name: asan
    needs: basics
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install llvm
        # Required to resolve symbols in sanitizer output
        run: sudo apt-get install -y llvm
      - name: Install Rust ${{ env.rust_nightly }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_nightly }}

      - uses: Swatinem/rust-cache@v2
      - name: asan
        run: cargo test --workspace --features $TOKIO_STABLE_FEATURES --target x86_64-unknown-linux-gnu --tests -- --test-threads 1 --nocapture
        env:
          RUSTFLAGS: -Z sanitizer=address --cfg tokio_no_tuning_tests
          # Ignore `trybuild` errors as they are irrelevant and flaky on nightly
          TRYBUILD: overwrite

  semver:
    name: semver
    needs: basics
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Check `tokio` semver
        uses: obi1kenobi/cargo-semver-checks-action@v2
        with:
          rust-toolchain: ${{ env.rust_stable }}
          package: tokio
          release-type: minor
          feature-group: only-explicit-features
          # We don't care about the semver of unstable tokio features.
          features: ${{ env.TOKIO_STABLE_FEATURES }}
      - name: Check semver for rest of the workspace
        if: ${{ !startsWith(github.event.pull_request.base.ref, 'tokio-1.') }}
        uses: obi1kenobi/cargo-semver-checks-action@v2
        with:
          rust-toolchain: ${{ env.rust_stable }}
          exclude: tokio
          release-type: minor

  cross-check:
    name: cross-check
    needs: basics
    runs-on: ubuntu-latest
    strategy:
      matrix:
        target:
          - powerpc-unknown-linux-gnu
          - powerpc64-unknown-linux-gnu
          - arm-linux-androideabi
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_stable }}
          target: ${{ matrix.target }}

      - uses: Swatinem/rust-cache@v2
      # We don't use --all-features since io-uring will be enabled and is not supported on those targets.
      - run: cargo check --workspace --features $TOKIO_STABLE_FEATURES --target ${{ matrix.target }}
        env:
          RUSTFLAGS: --cfg tokio_unstable -Dwarnings

  cross-check-tier3:
    name: cross-check-tier3
    needs: basics
    runs-on: ubuntu-latest
    strategy:
      matrix:
        target:
          - name: x86_64-unknown-haiku
            exclude_features: "taskdump" # taskdump is only available on Linux
#         - name: armv7-sony-vita-newlibeabihf
#           exclude_features: "process,signal,rt-process-signal,full,taskdump"
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_nightly }}
        uses: dtolnay/rust-toolchain@nightly
        with:
          toolchain: ${{ env.rust_nightly }}
          components: rust-src
      - name: Install cargo-hack
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-hack
      - uses: Swatinem/rust-cache@v2
      - run: cargo hack check -Zbuild-std --workspace --each-feature --target ${{ matrix.target.name }} --exclude-features "${{ matrix.target.exclude_features }}"
        env:
          RUSTFLAGS: --cfg tokio_unstable -Dwarnings

  cross-test-with-parking_lot:
    needs: basics
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - target: i686-unknown-linux-gnu
            os: ubuntu-latest
            extra_features: "taskdump"
          - target: armv5te-unknown-linux-gnueabi
            os: ubuntu-latest
          - target: armv7-unknown-linux-gnueabihf
            os: ubuntu-24.04-arm
          - target: aarch64-unknown-linux-gnu
            os: ubuntu-24.04-arm
            extra_features: "io-uring,taskdump"
          - target: aarch64-pc-windows-msvc
            os: windows-11-arm
    steps:
      - uses: actions/checkout@v4
      - name: Install Rust stable
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_stable }}
          target: ${{ matrix.target }}

      - name: Install cargo-nextest
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-nextest

      - uses: taiki-e/setup-cross-toolchain-action@v1
        with:
          target: ${{ matrix.target }}
          qemu: '7.2'

      - uses: Swatinem/rust-cache@v2
      - name: Tests run with all features (including parking_lot)
        run: |
          set -euxo pipefail
          # We use `--features "$TOKIO_STABLE_FEATURES"` instead of `--all-features` since
          # `--all-features` includes `io_uring` and `taskdump`,
          # which is not available on all targets.
          cargo nextest run -p tokio --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }} --target ${{ matrix.target }}
          cargo test --doc -p tokio --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }} --target ${{ matrix.target }}
        env:
          RUST_TEST_THREADS: 1
          RUSTFLAGS: --cfg tokio_unstable -Dwarnings --cfg tokio_no_tuning_tests
          RUSTDOCFLAGS: --cfg tokio_unstable -Dwarnings

  cross-test-without-parking_lot:
    needs: basics
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - target: i686-unknown-linux-gnu
            os: ubuntu-latest
            extra_features: "taskdump"
          - target: armv5te-unknown-linux-gnueabi
            os: ubuntu-latest
          - target: armv7-unknown-linux-gnueabihf
            os: ubuntu-24.04-arm
          - target: aarch64-unknown-linux-gnu
            os: ubuntu-24.04-arm
            extra_features: "io-uring,taskdump"
          - target: aarch64-pc-windows-msvc
            os: windows-11-arm
    steps:
      - uses: actions/checkout@v4
      - name: Install Rust stable
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_stable }}
          target: ${{ matrix.target }}

      - name: Install cargo-nextest
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-nextest

      - uses: taiki-e/setup-cross-toolchain-action@v1
        with:
          target: ${{ matrix.target }}
          qemu: '7.2'

      - name: Remove `parking_lot` from `full` feature
        run: sed -i '0,/parking_lot/{/parking_lot/d;}' tokio/Cargo.toml

      - uses: Swatinem/rust-cache@v2
      # The `tokio_no_parking_lot` cfg is here to ensure the `sed` above does not silently break.
      - name: Tests run with all features (without parking_lot)
        run: |
          set -euxo pipefail
          # We use `--features "$TOKIO_STABLE_FEATURES"` instead of `--all-features` since
          # `--all-features` includes `io_uring` and `taskdump`,
          # which is not available on all targets.
          cargo nextest run -p tokio --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }} --target ${{ matrix.target }}
          cargo test --doc -p tokio --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }} --target ${{ matrix.target }}
        env:
          RUST_TEST_THREADS: 1
          RUSTFLAGS: --cfg tokio_unstable -Dwarnings --cfg tokio_no_parking_lot --cfg tokio_no_tuning_tests ${{ matrix.rustflags }}
          RUSTDOCFLAGS: --cfg tokio_unstable -Dwarnings

  # See https://github.com/tokio-rs/tokio/issues/5187
  no-atomic-u64-test:
    name: Test tokio --all-features on i686-unknown-linux-gnu without AtomicU64
    needs: basics
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_nightly }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_nightly }}
          components: rust-src

      - name: Install cargo-nextest
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-nextest

      - uses: taiki-e/setup-cross-toolchain-action@v1
        with:
          target: i686-unknown-linux-gnu
          qemu: '7.2'

      - uses: Swatinem/rust-cache@v2
      - name: test tokio --all-features
        run: |
          cargo nextest run -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --features $TOKIO_STABLE_FEATURES,taskdump
          cargo test --doc -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --features $TOKIO_STABLE_FEATURES,taskdump
        env:
          RUST_TEST_THREADS: 1
          RUSTDOCFLAGS: --cfg tokio_unstable
          RUSTFLAGS: --cfg tokio_unstable -Dwarnings --cfg tokio_no_tuning_tests

  no-atomic-u64-check:
    name: Check tokio --feature-powerset --depth 2 on i686-unknown-linux-gnu without AtomicU64
    needs: basics
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_nightly }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_nightly }}
          components: rust-src
      - name: Install cargo-hack
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-hack

      - uses: Swatinem/rust-cache@v2

      # https://github.com/tokio-rs/tokio/pull/5356
      # https://github.com/tokio-rs/tokio/issues/5373
      - name: Check
        # We use `--skip io-uring` since io-uring crate doesn't provide a binding for the i686 target.
        run: cargo hack check -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --feature-powerset --skip io-uring --depth 2 --keep-going
        env:
          RUSTFLAGS: --cfg tokio_unstable -Dwarnings

  features:
    name: features exclude ${{ matrix.name }}
    needs: basics
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - name: ""
            rustflags: ""
            exclude_features: "io-uring,taskdump"
          - name: "--unstable"
            rustflags: "--cfg tokio_unstable -Dwarnings"
            exclude_features: "io-uring,taskdump"
          - name: "--unstable io-uring,taskdump"
            rustflags: "--cfg tokio_unstable -Dwarnings"
            exclude_features: ""
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_nightly }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_nightly }}
          target: ${{ matrix.target }}
      - name: Install cargo-hack
        uses: taiki-e/install-action@cargo-hack

      - uses: Swatinem/rust-cache@v2
      - name: check --feature-powerset ${{ matrix.name }}
        run: cargo hack check --all --feature-powerset --exclude-features "${{ matrix.exclude_features }}" --depth 2 --keep-going
        env:
          RUSTFLAGS: ${{ matrix.rustflags }}

  minrust:
    name: minrust
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_min }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_min }}
      - name: Install cargo-hack
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-hack
      - uses: Swatinem/rust-cache@v2
      - name: "cargo check"
        run: |
          if [[ "${{ github.event.pull_request.base.ref }}" =~ ^tokio-1\..* ]]; then
            # Only check `tokio` crate as the PR is backporting to an earlier tokio release.

            cargo check -p tokio --features $TOKIO_STABLE_FEATURES
          else
            # Check all crates in the workspace

            cargo check -p tokio --features $TOKIO_STABLE_FEATURES
            # Other crates doesn't have unstable features, so we can use --all-features.
            cargo hack check -p tokio-macros -p tokio-stream -p tokio-util -p tokio-test --all-features
          fi

  minimal-versions:
    name: minimal-versions
    needs: basics
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_nightly }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_nightly }}
      - name: Install cargo-hack
        uses: taiki-e/install-action@cargo-hack

      - uses: Swatinem/rust-cache@v2
      - name: "check -Z minimal-versions"
        run: |
          # Remove dev-dependencies from Cargo.toml to prevent the next `cargo update`
          # from determining minimal versions based on dev-dependencies.
          cargo hack --remove-dev-deps --workspace
          # Update Cargo.lock to minimal version dependencies.
          cargo update -Z minimal-versions
          cargo hack check -p tokio --features $TOKIO_STABLE_FEATURES --ignore-private
          cargo hack check -p tokio-macros -p tokio-stream -p tokio-util -p tokio-test --all-features --ignore-private
      - name: "check --all-features --unstable -Z minimal-versions"
        env:
          RUSTFLAGS: --cfg tokio_unstable -Dwarnings
        run: |
          # Remove dev-dependencies from Cargo.toml to prevent the next `cargo update`
          # from determining minimal versions based on dev-dependencies.
          cargo hack --remove-dev-deps --workspace
          # Update Cargo.lock to minimal version dependencies.
          cargo update -Z minimal-versions
          cargo hack check --all-features --ignore-private

  fmt:
    name: fmt
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_stable }}
          components: rustfmt
      - uses: Swatinem/rust-cache@v2
      # Check fmt
      - name: "rustfmt --check"
        # Workaround for rust-lang/cargo#7732
        run: |
          if ! rustfmt --check --edition 2021 $(git ls-files '*.rs'); then
            printf "Please run \`rustfmt --edition 2021 \$(git ls-files '*.rs')\` to fix rustfmt errors.\nSee CONTRIBUTING.md for more details.\n" >&2
            exit 1
          fi

  clippy:
    name: clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_clippy }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_clippy }}
          components: clippy
      - uses: Swatinem/rust-cache@v2
      # Run clippy
      - name: "clippy --workspace --features ${{ env.TOKIO_STABLE_FEATURES }}"
        run: |
          cargo clippy --workspace --tests --no-deps --features $TOKIO_STABLE_FEATURES
          # Removing the tokio workspace patch to check without path dependencies
          # (if not specified differently in the crate)
          perl -0 -i.bak -pe 's/\[patch\.crates-io\].+\n\[/[/s' Cargo.toml
          cargo clippy --workspace --exclude tokio --tests --no-deps --features $TOKIO_STABLE_FEATURES
      - name: "clippy --workspace --all-features --unstable"
        run: |
          # Forcing the cargo lock regeneration to apply the tokio patch
          rm Cargo.lock
          mv Cargo.toml Cargo.toml.nopatch
          mv Cargo.toml.bak Cargo.toml
          cargo clippy --workspace --tests --no-deps --all-features
          # check without path dependencies
          mv Cargo.toml.nopatch Cargo.toml
          cargo clippy --workspace --exclude tokio --tests --no-deps --all-features
        env:
          RUSTFLAGS: --cfg tokio_unstable -Dwarnings

  docs:
    name: docs
    runs-on: ${{ matrix.run.os }}
    strategy:
      matrix:
        run:
          - os: windows-latest
            extra_features: "tracing"
          - os: ubuntu-latest
            extra_features: "tracing,io-uring,taskdump"

    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_nightly }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_nightly }}
      - uses: Swatinem/rust-cache@v2
      - name: "doc --lib --all-features"
        run: cargo doc --lib --no-deps --document-private-items --features $TOKIO_STABLE_FEATURES,${{ matrix.run.extra_features }}
        env:
          RUSTFLAGS: --cfg docsrs --cfg tokio_unstable
          RUSTDOCFLAGS: --cfg docsrs --cfg tokio_unstable -Dwarnings

  loom-compile:
    name: build loom tests
    needs: basics
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_stable }}
      - uses: Swatinem/rust-cache@v2
      - name: build --cfg loom
        run: cargo test --no-run --lib --features full
        working-directory: tokio
        env:
          RUSTFLAGS: --cfg loom --cfg tokio_unstable -Dwarnings

  check-readme:
    name: Check README
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Verify that both READMEs are identical
        run: diff README.md tokio/README.md

      - name: Verify that Tokio version is up to date in README
        working-directory: tokio
        run: grep -q "$(sed '/^version = /!d' Cargo.toml | head -n1)" README.md

  test-hyper:
    name: Test hyper
    needs: basics
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os:
          - windows-latest
          - ubuntu-latest
          - macos-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_stable }}

      - name: Clone hyper
        run: git clone https://github.com/hyperium/hyper.git

      - name: Checkout the latest release because HEAD maybe contains breakage.
        run: |
          set -x
          tag=$(git describe --abbrev=0 --tags)
          git checkout "${tag}"
        working-directory: hyper

      - name: Patch hyper to use tokio from this repository
        run: |
          set -x
          echo '[workspace]' >>Cargo.toml
          echo '[patch.crates-io]' >>Cargo.toml
          echo 'tokio = { path = "../tokio" }' >>Cargo.toml
          echo 'tokio-util = { path = "../tokio-util" }' >>Cargo.toml
          echo 'tokio-stream = { path = "../tokio-stream" }' >>Cargo.toml
          echo 'tokio-test = { path = "../tokio-test" }' >>Cargo.toml
          git diff
        working-directory: hyper

      - uses: Swatinem/rust-cache@v2
        with:
          # The cargo workspaces and target directory configuration.
          # These entries are separated by newlines and have the form
          # `$workspace -> $target`. The `$target` part is treated as a directory
          # relative to the `$workspace` and defaults to "target" if not explicitly given.
          # default: ". -> target"
          workspaces: "./hyper"

      - name: Test hyper
        run: cargo test --features full
        working-directory: hyper

  test-quinn:
    name: Test Quinn
    needs: basics
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os:
          - windows-latest
          - ubuntu-latest
          - macos-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_stable }}

      - name: Clone Quinn
        run: git clone https://github.com/quinn-rs/quinn.git

      - name: Checkout the latest release because HEAD maybe contains breakage.
        run: |
          set -x
          tag=$(git describe --abbrev=0 --tags)
          git checkout "${tag}"
        working-directory: quinn

      - name: Patch Quinn to use tokio from this repository
        run: |
          set -x
          echo '[patch.crates-io]' >>Cargo.toml
          echo 'tokio = { path = "../tokio" }' >>Cargo.toml
          git diff
        working-directory: quinn

      - uses: Swatinem/rust-cache@v2
        with:
          # The cargo workspaces and target directory configuration.
          # These entries are separated by newlines and have the form
          # `$workspace -> $target`. The `$target` part is treated as a directory
          # relative to the `$workspace` and defaults to "target" if not explicitly given.
          # default: ". -> target"
          workspaces: "./quinn"

      - name: Test Quinn
        working-directory: quinn
        env:
          RUSTFLAGS: ""
        run: cargo test

  x86_64-fortanix-unknown-sgx:
    name: build tokio for x86_64-fortanix-unknown-sgx
    needs: basics
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_nightly }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_nightly }}
          target: x86_64-fortanix-unknown-sgx
      - uses: Swatinem/rust-cache@v2
      # NOTE: Currently the only test we can run is to build tokio with rt and sync features.
      - name: build tokio
        run: cargo build --target x86_64-fortanix-unknown-sgx --features rt,sync
        working-directory: tokio

  check-redox:
    name: build tokio for redox-os
    needs: basics
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_nightly }}
        uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ env.rust_nightly }}
          target: x86_64-unknown-redox
      - name: check tokio on redox
        run: cargo check --target x86_64-unknown-redox --features $TOKIO_STABLE_FEATURES
        working-directory: tokio

  wasm32-unknown-unknown:
    name: test tokio for wasm32-unknown-unknown (${{ matrix.name }})
    needs: basics
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - name: macros sync
            features: "macros sync"
          - name: macros sync rt
            features: "macros sync rt"
          - name: macros sync time rt
            features: "macros sync time rt"
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_stable }}
      - name: Install wasm-pack
        uses: taiki-e/install-action@wasm-pack

      - uses: Swatinem/rust-cache@v2
      - name: test tokio (${{ matrix.name }})
        run: wasm-pack test --node -- --features "${{ matrix.features }}"
        working-directory: tokio

  wasm32-wasip1:
    name: ${{ matrix.target }}
    needs: basics
    runs-on: ubuntu-latest
    strategy:
      matrix:
        target:
          - wasm32-wasip1
          - wasm32-wasip1-threads
    env:
      rust_stable: '1.93.1'
    steps:
      - uses: actions/checkout@v4
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_stable }}
          targets: ${{ matrix.target }}

      # Install dependencies
      - name: Install cargo-hack, wasmtime
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-hack,wasmtime

      - uses: Swatinem/rust-cache@v2
      - name: WASI test tokio full
        run: cargo test -p tokio --target ${{ matrix.target }} --features "sync,macros,io-util,rt,time"
        env:
          CARGO_TARGET_WASM32_WASIP1_RUNNER: "wasmtime run --"
          CARGO_TARGET_WASM32_WASIP1_THREADS_RUNNER: "wasmtime run -W bulk-memory=y -W threads=y -W shared-memory=y -S threads=y --"
          RUSTFLAGS: --cfg tokio_unstable -Dwarnings -C target-feature=+atomics,+bulk-memory -C link-args=--max-memory=67108864
          # in order to run doctests for unstable features, we must also pass
          # the unstable cfg to RustDoc
          RUSTDOCFLAGS: --cfg tokio_unstable

      - name: WASI test tokio-util full
        run: cargo test -p tokio-util --target ${{ matrix.target }} --features full
        env:
          CARGO_TARGET_WASM32_WASIP1_RUNNER: "wasmtime run --"
          CARGO_TARGET_WASM32_WASIP1_THREADS_RUNNER: "wasmtime run -W bulk-memory=y -W threads=y -W shared-memory=y -S threads=y --"
          RUSTFLAGS: --cfg tokio_unstable -Dwarnings -C target-feature=+atomics,+bulk-memory -C link-args=--max-memory=67108864
          RUSTDOCFLAGS: -C link-args=--max-memory=67108864

      - name: WASI test tokio-stream
        run: cargo test --manifest-path=tokio-stream/Cargo.toml --target ${{ matrix.target }} --features time,net,io-util,sync
        env:
          CARGO_TARGET_WASM32_WASIP1_RUNNER: "wasmtime run --"
          CARGO_TARGET_WASM32_WASIP1_THREADS_RUNNER: "wasmtime run -W bulk-memory=y -W threads=y -W shared-memory=y -S threads=y --"
          RUSTFLAGS: --cfg tokio_unstable -Dwarnings -C target-feature=+atomics,+bulk-memory -C link-args=--max-memory=67108864

      - name: test tests-integration --features wasi-rt
        # TODO: this should become: `cargo hack wasi test --each-feature`
        run: cargo test --target ${{ matrix.target }} --test rt_yield --features wasi-rt
        if: matrix.target == 'wasm32-wasip1'
        working-directory: tests-integration
        env:
          CARGO_TARGET_WASM32_WASIP1_RUNNER: "wasmtime run --"
          RUSTFLAGS: -Dwarnings -C target-feature=+atomics,+bulk-memory -C link-args=--max-memory=67108864

      - name: test tests-integration --features wasi-threads-rt
        run: cargo test --target ${{ matrix.target }} --features wasi-threads-rt
        if: matrix.target == 'wasm32-wasip1-threads'
        working-directory: tests-integration
        env:
          CARGO_TARGET_WASM32_WASIP1_THREADS_RUNNER: "wasmtime run -W bulk-memory=y -W threads=y -W shared-memory=y -S threads=y --"
          RUSTFLAGS: --cfg tokio_unstable -Dwarnings -C target-feature=+atomics,+bulk-memory -C link-args=--max-memory=67108864

  check-external-types:
    name: check-external-types (${{ matrix.os }})
    needs: basics
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - os: windows-latest
            # Windows neither supports io-uring nor taskdump.
            extra_features: "tracing"
          - os: ubuntu-latest
            # includes all unstable features.
            extra_features: "tracing,io-uring,taskdump"
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ matrix.rust }}
        uses: dtolnay/rust-toolchain@stable
        with:
          # `check-external-types` requires a specific Rust nightly version. See
          # the README for details: https://github.com/awslabs/cargo-check-external-types
          toolchain: nightly-2025-08-06
      - uses: Swatinem/rust-cache@v2
      - name: Install cargo-check-external-types
        uses: taiki-e/cache-cargo-install-action@v1
        with:
          tool: cargo-check-external-types@0.3.0
      - name: check-external-types
        env:
          RUSTFLAGS: --cfg tokio_unstable -Dwarnings
          RUSTDOCFLAGS: --cfg tokio_unstable
        run: cargo check-external-types --features $TOKIO_STABLE_FEATURES,${{ matrix.extra_features }}
        working-directory: tokio

  check-fuzzing:
    name: check-fuzzing
    needs: basics
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install Rust ${{ env.rust_nightly }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_nightly }}
      - uses: Swatinem/rust-cache@v2
      - name: Install cargo-fuzz
        run: cargo install cargo-fuzz
      - name: Check /tokio/
        run: cargo fuzz check --all-features
        working-directory: tokio
      - name: Check /tokio-stream/
        run: cargo fuzz check --all-features
        working-directory: tokio-stream

  check-spelling:
    name: check-spelling
    needs: basics
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.rust_stable }}
      - name: Install cargo-spellcheck
        uses: taiki-e/install-action@v2
        with:
          tool: cargo-spellcheck
      - uses: actions/checkout@v4
      - name: Make sure dictionary words are sorted and unique
        run: |
          FILE="spellcheck.dic"

          # Verify the first line is an integer.
          first_line=$(head -n 1 "$FILE")
          if ! [[ "$first_line" =~ ^[0-9]+$ ]]; then
            echo "Error: The first line of $FILE must be an integer, but got: '$first_line'"
            exit 1
          fi
          expected_count="$first_line"

          # Check that the number of lines matches the integer.
          # xargs (with no arguments) will strip leading/trailing whitespacefrom wc's output.
          actual_count=$(sed '1d' "$FILE" | wc -l | xargs)
          if [ "$expected_count" -ne "$actual_count" ]; then
            echo "Error: The number of lines ($actual_count) does not match $expected_count."
            exit 1
          fi

          # `sed` removes the first line (number of words).
          #
          # `sort` makes sure everything in between is sorted
          # and contains no duplicates.
          #
          # Since `sort` is sensitive to locale, we set it
          # using LC_ALL to en_US.UTF8 to be consistent in different
          # environments.

          (
            sed '1d' $FILE | LC_ALL=en_US.UTF8 sort -uc
          ) || {
            echo "Dictionary is not in sorted order. Correct order is:"
            LC_ALL=en_US.UTF8 sort -u <(sed '1d' $FILE)
            false
          }
      - name: Run cargo-spellcheck
        run: |
          if ! cargo spellcheck --code 1
          then
              echo ''
              echo ''
              echo 'If this is a Rust method/type/variable name, then you should'
              echo 'enclose it in backticks like this: `MyRustType`.'
              echo ''
              echo 'If this is a real word, then you can add it to spellcheck.dic'
              exit 1
          fi
      - name: Detect trailing whitespace
        run: |
          if grep --exclude-dir=.git --exclude-dir=target -rne '\s$' .
          then
              echo ''
              echo 'Please remove trailing whitespace from these lines.'
              exit 1
          fi

  get-latest-kernel-version:
    runs-on: ubuntu-latest
    outputs:
      kernel_version: ${{ steps.fetch.outputs.kernel_version }}
    steps:
      - name: Fetch latest stable kernel
        id: fetch
        run: |
          KERNEL_VERSION=$(curl -s https://www.kernel.org/releases.json | jq -r '.latest_stable.version')
          echo "kernel_version=$KERNEL_VERSION" >> $GITHUB_OUTPUT

  test-io-uring-on-specific-kernel-versions:
    name: Test io_uring on Linux ${{ matrix.kernel_version }}
    needs: [get-latest-kernel-version, basics]
    strategy:
      matrix:
        kernel_version:
          # A latest stable kernel version
          - ${{ needs.get-latest-kernel-version.outputs.kernel_version }}
          # A kernel version that doesn't support io_uring
          - '4.19.325'
    uses: ./.github/workflows/uring-kernel-version-test.yml
    with:
      kernel_version: ${{ matrix.kernel_version }}


================================================
FILE: .github/workflows/labeler.yml
================================================
name: "Pull Request Labeler"
on:
- pull_request_target

# See .github/labeler.yml file

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
  cancel-in-progress: true

permissions:
  contents: read

jobs:
  triage:
    permissions:
      contents: read  # for actions/labeler to determine modified files
      pull-requests: write  # for actions/labeler to add labels to PRs
    runs-on: ubuntu-latest
    if: github.repository_owner == 'tokio-rs'
    steps:
    - uses: actions/labeler@v3
      with:
        repo-token: "${{ secrets.GITHUB_TOKEN }}"
        sync-labels: true


================================================
FILE: .github/workflows/loom.yml
================================================
on:
  push:
    branches: ["master", "tokio-*.x"]
  pull_request:
    types: [labeled, opened, synchronize, reopened]
    branches: ["master", "tokio-*.x"]

name: Loom

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
  cancel-in-progress: true

env:
  RUSTFLAGS: -Dwarnings --cfg loom --cfg tokio_unstable -C debug_assertions
  LOOM_MAX_PREEMPTIONS: 2
  LOOM_MAX_BRANCHES: 10000
  RUST_BACKTRACE: 1
  # Change to specific Rust release to pin
  rust_stable: stable

permissions:
  contents: read

jobs:
  loom-blocking:
    name: loom tokio::runtime::spawn_blocking
    # base_ref is null when it's not a pull request
    if: github.repository_owner == 'tokio-rs' && (contains(github.event.pull_request.labels.*.name, 'R-loom-blocking') || (github.base_ref == null))
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@master
        with:
            toolchain: ${{ env.rust_stable }}
      - uses: Swatinem/rust-cache@v2
      - name: run tests
        run: cargo test --lib --release --features full -- --nocapture loom_blocking
        working-directory: tokio

  loom-sync:
    name: loom tokio::sync
    # base_ref is null when it's not a pull request
    if: github.repository_owner == 'tokio-rs' && (contains(github.event.pull_request.labels.*.name, 'R-loom-sync') || (github.base_ref == null))
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@master
        with:
            toolchain: ${{ env.rust_stable }}
      - uses: Swatinem/rust-cache@v2
      - name: run tests
        run: cargo test --lib --release --features full -- --nocapture sync::tests
        working-directory: tokio

  loom-time-driver:
    name: loom time driver
    # base_ref is null when it's not a pull request
    if: github.repository_owner == 'tokio-rs' && (contains(github.event.pull_request.labels.*.name, 'R-loom-time-driver') || (github.base_ref == null))
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@master
        with:
            toolchain: ${{ env.rust_stable }}
      - uses: Swatinem/rust-cache@v2
      - name: run tests
        run: cargo test --lib --release --features full -- --nocapture runtime::time
        working-directory: tokio

  loom-current-thread:
    name: loom current-thread scheduler
    # base_ref is null when it's not a pull request
    if: github.repository_owner == 'tokio-rs' && (contains(github.event.pull_request.labels.*.name, 'R-loom-current-thread') || (github.base_ref == null))
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@master
        with:
            toolchain: ${{ env.rust_stable }}
      - uses: Swatinem/rust-cache@v2
      - name: run tests
        run: cargo test --lib --release --features full -- --nocapture loom_current_thread
        working-directory: tokio

  loom-multi-thread:
    name: loom multi-thread scheduler
    # base_ref is null when it's not a pull request
    if: github.repository_owner == 'tokio-rs' && (contains(github.event.pull_request.labels.*.name, 'R-loom-multi-thread') || (github.base_ref == null))
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - scope: loom_multi_thread::group_a
          - scope: loom_multi_thread::group_b
          - scope: loom_multi_thread::group_c
          - scope: loom_multi_thread::group_d
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@master
        with:
            toolchain: ${{ env.rust_stable }}
      - uses: Swatinem/rust-cache@v2
      - name: loom ${{ matrix.scope }}
        run: cargo test --lib --release --features full -- --nocapture $SCOPE
        working-directory: tokio
        env:
          SCOPE: ${{ matrix.scope }}

  loom-util:
    name: loom tokio-util
    # base_ref is null when it's not a pull request
    if: github.repository_owner == 'tokio-rs' && (contains(github.event.pull_request.labels.*.name, 'R-loom-util') || (github.base_ref == null))
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@master
        with:
            toolchain: ${{ env.rust_stable }}
      - uses: Swatinem/rust-cache@v2
      - name: run tests
        run: cargo test --lib --release --features full -- --nocapture
        working-directory: tokio-util


================================================
FILE: .github/workflows/pr-audit.yml
================================================
name: Pull Request Security Audit

on:
  push:
    paths:
      - '**/Cargo.toml'
  pull_request:
    paths:
      - '**/Cargo.toml'

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
  cancel-in-progress: true

permissions:
  contents: read

jobs:
  cargo-deny:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v5
    - uses: EmbarkStudios/cargo-deny-action@v2


================================================
FILE: .github/workflows/stress-test.yml
================================================
name: Stress Test
on:
  pull_request:
  push:
    branches:
      - master

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
  cancel-in-progress: true

env:
  RUSTFLAGS: -Dwarnings
  RUST_BACKTRACE: 1
  # Change to specific Rust release to pin
  rust_stable: 1.82

permissions:
  contents: read

jobs:
  stress-test:
    name: Stress Test
    runs-on: ubuntu-latest
    strategy:
      matrix:
        stress-test:
          - simple_echo_tcp
    steps:
      - uses: actions/checkout@v5
      - name: Install Rust ${{ env.rust_stable }}
        uses: dtolnay/rust-toolchain@master
        with:
            toolchain: ${{ env.rust_stable }}
      - name: Install Valgrind
        uses: taiki-e/install-action@valgrind

      - uses: Swatinem/rust-cache@v2
      # Compiles each of the stress test examples.
      - name: Compile stress test examples
        run: cargo build -p stress-test --release --example ${{ matrix.stress-test }}

      # Runs each of the examples using Valgrind. Detects leaks and displays them.
      - name: Run valgrind
        run: valgrind --error-exitcode=1 --leak-check=full --show-leak-kinds=all --fair-sched=yes ./target/release/examples/${{ matrix.stress-test }}


================================================
FILE: .github/workflows/uring-kernel-version-test.yml
================================================
name: Uring Kernel Version Test

on:
  workflow_call:
    inputs:
      kernel_version:
        description: 'Version of the Linux kernel to build'
        required: true
        type: string

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      KERNEL_VERSION: ${{ inputs.kernel_version }}
    steps:
      - uses: actions/checkout@v5

      - name: Install system dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y \
            build-essential bison flex libssl-dev libelf-dev \
            qemu-system-x86 busybox-static cpio xz-utils wget

      - name: Cache Linux source
        id: cache-kernel
        uses: actions/cache@v4
        with:
          path: linux-${{ env.KERNEL_VERSION }}
          key: kernel-${{ env.KERNEL_VERSION }}

      - name: Download & build Linux kernel
        if: steps.cache-kernel.outputs.cache-hit != 'true'
        run: |
          MAJOR=${KERNEL_VERSION%%.*}
          wget https://cdn.kernel.org/pub/linux/kernel/v${MAJOR}.x/linux-${KERNEL_VERSION}.tar.xz
          tar xf linux-${KERNEL_VERSION}.tar.xz
          cd linux-${KERNEL_VERSION}
          make defconfig
          make -j$(nproc)

      - name: Generate test binaries with io_uring enabled
        run: |
          # Build both integration (tokio/tests/) and unit (e.g., tokio/src/fs/file/tests.rs) tests with io_uring enabled
          rustup target add x86_64-unknown-linux-musl
          RUSTFLAGS="--cfg tokio_unstable" \
            cargo test -p tokio --features full,io-uring \
            --target x86_64-unknown-linux-musl --test 'fs*' --lib --no-run

      - name: Prepare initramfs + tests binaries
        run: |
          set -e
          rm -rf initramfs
          mkdir -p initramfs/{bin,bin/tests,sbin,proc,sys,tmp}

          # Copy test binaries into initramfs
          for bin in target/x86_64-unknown-linux-musl/debug/deps/{fs_*,tokio-*}; do
            if [ -f "$bin" ] && [ -x "$bin" ]; then
              cp "$bin" initramfs/bin/tests
            fi
          done

          # Add BusyBox & symlinks
          cp /usr/bin/busybox initramfs/bin/
          for cmd in sh mount uname true sleep; do ln -sf busybox initramfs/bin/$cmd; done
          ln -sf ../bin/busybox initramfs/sbin/poweroff

          # Generate init script
          cat > initramfs/init << 'EOF'
          #!/bin/sh
          set -e
          mkdir -p /dev
          # create device nodes, as some tests require them
          mknod /dev/null c 1 3
          mknod /dev/zero c 1 5
          mknod /dev/tty c 5 0
          mount -t proc proc /proc
          mount -t sysfs sysfs /sys
          mkdir -p /tmp && mount -t tmpfs -o mode=1777 tmpfs /tmp
          for f in /bin/tests/*; do RUST_BACKTRACE=1 "$f" ; done
          EOF
          chmod +x initramfs/init

          # Pack into a CPIO archive
          (cd initramfs && find . -print0 \
            | cpio --null -ov --format=newc | gzip -9 > ../initramfs.cpio.gz)

      - name: Run tests in QEMU
        run: |
          qemu-system-x86_64 \
            -kernel linux-${{ env.KERNEL_VERSION }}/arch/x86/boot/bzImage \
            -initrd initramfs.cpio.gz \
            -append "console=ttyS0 rootfstype=ramfs panic=1" \
            -nographic -no-reboot -m 1024 -action panic=exit-failure 2>&1 | tee qemu-output.log

          # qemu always exits with 0, so we check if the tests passed by using grep.
          if grep -q "test result: FAILED" qemu-output.log; then
            echo "tests failed (QEMU exited abnormally)"
            exit 1
          else
            echo "all tests passed"
          fi


================================================
FILE: .gitignore
================================================
target
Cargo.lock

.cargo/config.toml
.cargo/config



================================================
FILE: CODE_OF_CONDUCT.md
================================================
# Code of Conduct

The Tokio project adheres to the [Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct). This describes the minimum behavior expected from all contributors.

## Enforcement

Instances of violations of the Code of Conduct can be reported by contacting the project team at [moderation@tokio.rs](mailto:moderation@tokio.rs).


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to Tokio

Thanks for your help improving Tokio! We are so happy to have you!

There are opportunities to contribute to Tokio at any level. It doesn't matter if
you are just getting started with Rust or are the most weathered expert, we can
use your help.

**No contribution is too small and all contributions are valued.**

See the [contributing guidelines] to get started.

[contributing guidelines]: docs/contributing/README.md

## Code of Conduct

The Tokio project adheres to the [Rust Code of Conduct][coc]. This describes
the _minimum_ behavior expected from all contributors. Instances of violations of the
Code of Conduct can be reported by contacting the project team at
[moderation@tokio.rs](mailto:moderation@tokio.rs).

[coc]: https://github.com/rust-lang/rust/blob/master/CODE_OF_CONDUCT.md

## Need Help?

Reach out to us on the [Discord server] for any concern not covered in this guide.

[Discord server]: https://discord.gg/tokio

## LTS guarantees

In Tokio ≥1.0.0, each LTS release comes with the guarantee of at least one year of
backported fixes.

The goal of these guarantees is to provide stability to the ecosystem.

## Minimum Supported Rust Version (MSRV)

* All Tokio ≥1.0.0 releases will support at least a 6-month old Rust
  compiler release.
* The MSRV will only be increased on 1.x releases.

## Versioning Policy

With Tokio ≥1.0.0:

* Patch (1.\_.x) releases _should only_ contain bug fixes or documentation
  changes. Besides this, these releases should not substantially change
  runtime behavior.
* Minor (1.x) releases may contain new functionality, MSRV increases (see
  above), minor dependency updates, deprecations, and larger internal
  implementation changes.

This is as defined by [Semantic Versioning 2.0](https://semver.org/).


================================================
FILE: Cargo.toml
================================================
[workspace]
resolver = "2"
members = [
  "tokio",
  "tokio-macros",
  "tokio-test",
  "tokio-stream",
  "tokio-util",

  # Internal
  "benches",
  "examples",
  "stress-test",
  "tests-build",
  "tests-integration",
]

[patch.crates-io]
tokio = { path = "tokio" }
tokio-macros = { path = "tokio-macros" }
tokio-stream = { path = "tokio-stream" }
tokio-test = { path = "tokio-test" }
tokio-util = { path = "tokio-util" }

[workspace.metadata.spellcheck]
config = "spellcheck.toml"

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
  'cfg(fuzzing)',
  'cfg(loom)',
  'cfg(mio_unsupported_force_poll_poll)',
  'cfg(tokio_allow_from_blocking_fd)',
  'cfg(tokio_internal_mt_counters)',
  'cfg(tokio_no_parking_lot)',
  'cfg(tokio_no_tuning_tests)',
  'cfg(tokio_unstable)',
  'cfg(target_os, values("cygwin"))',
] }


================================================
FILE: Cross.toml
================================================
[build.env]
passthrough = [
    "RUSTFLAGS",
    "RUST_BACKTRACE",
]


================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) Tokio Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
*[TokioConf 2026 program and tickets are now available!](https://tokioconf.com)*

---

# Tokio

A runtime for writing reliable, asynchronous, and slim applications with
the Rust programming language. It is:

* **Fast**: Tokio's zero-cost abstractions give you bare-metal
  performance.

* **Reliable**: Tokio leverages Rust's ownership, type system, and
  concurrency model to reduce bugs and ensure thread safety.

* **Scalable**: Tokio has a minimal footprint, and handles backpressure
  and cancellation naturally.

[![Crates.io][crates-badge]][crates-url]
[![MIT licensed][mit-badge]][mit-url]
[![Build Status][actions-badge]][actions-url]
[![Discord chat][discord-badge]][discord-url]

[crates-badge]: https://img.shields.io/crates/v/tokio.svg
[crates-url]: https://crates.io/crates/tokio
[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg
[mit-url]: https://github.com/tokio-rs/tokio/blob/master/LICENSE
[actions-badge]: https://github.com/tokio-rs/tokio/workflows/CI/badge.svg
[actions-url]: https://github.com/tokio-rs/tokio/actions?query=workflow%3ACI+branch%3Amaster
[discord-badge]: https://img.shields.io/discord/500028886025895936.svg?logo=discord&style=flat-square
[discord-url]: https://discord.gg/tokio

[Website](https://tokio.rs) |
[Guides](https://tokio.rs/tokio/tutorial) |
[API Docs](https://docs.rs/tokio/latest/tokio) |
[Chat](https://discord.gg/tokio)

## Overview

Tokio is an event-driven, non-blocking I/O platform for writing
asynchronous applications with the Rust programming language. At a high
level, it provides a few major components:

* A multithreaded, work-stealing based task [scheduler].
* A reactor backed by the operating system's event queue (epoll, kqueue,
  IOCP, etc.).
* Asynchronous [TCP and UDP][net] sockets.

These components provide the runtime components necessary for building
an asynchronous application.

[net]: https://docs.rs/tokio/latest/tokio/net/index.html
[scheduler]: https://docs.rs/tokio/latest/tokio/runtime/index.html

## Example

A basic TCP echo server with Tokio.

Make sure you enable the full features of the tokio crate on Cargo.toml:

```toml
[dependencies]
tokio = { version = "1.50.0", features = ["full"] }
```
Then, on your main.rs:

```rust,no_run
use tokio::net::TcpListener;
use tokio::io::{AsyncReadExt, AsyncWriteExt};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let listener = TcpListener::bind("127.0.0.1:8080").await?;

    loop {
        let (mut socket, _) = listener.accept().await?;

        tokio::spawn(async move {
            let mut buf = [0; 1024];

            // In a loop, read data from the socket and write the data back.
            loop {
                let n = match socket.read(&mut buf).await {
                    // socket closed
                    Ok(0) => return,
                    Ok(n) => n,
                    Err(e) => {
                        eprintln!("failed to read from socket; err = {:?}", e);
                        return;
                    }
                };

                // Write the data back
                if let Err(e) = socket.write_all(&buf[0..n]).await {
                    eprintln!("failed to write to socket; err = {:?}", e);
                    return;
                }
            }
        });
    }
}
```

More examples can be found [here][examples]. For a larger "real world" example, see the
[mini-redis] repository.

[examples]: https://github.com/tokio-rs/tokio/tree/master/examples
[mini-redis]: https://github.com/tokio-rs/mini-redis/

To see a list of the available feature flags that can be enabled, check our
[docs][feature-flag-docs].

## Getting Help

First, see if the answer to your question can be found in the [Guides] or the
[API documentation]. If the answer is not there, there is an active community in
the [Tokio Discord server][chat]. We would be happy to try to answer your
question. You can also ask your question on [the discussions page][discussions].

[Guides]: https://tokio.rs/tokio/tutorial
[API documentation]: https://docs.rs/tokio/latest/tokio
[chat]: https://discord.gg/tokio
[discussions]: https://github.com/tokio-rs/tokio/discussions
[feature-flag-docs]: https://docs.rs/tokio/#feature-flags

## Contributing

:balloon: Thanks for your help improving the project! We are so happy to have
you! We have a [contributing guide][guide] to help you get involved in the Tokio
project.

[guide]: https://github.com/tokio-rs/tokio/blob/master/docs/contributing/README.md

## Related Projects

In addition to the crates in this repository, the Tokio project also maintains
several other libraries, including:

* [`axum`]: A web application framework that focuses on ergonomics and modularity.

* [`hyper`]: A fast and correct HTTP/1.1 and HTTP/2 implementation for Rust.

* [`tonic`]: A gRPC over HTTP/2 implementation focused on high performance, interoperability, and flexibility.

* [`warp`]: A super-easy, composable, web server framework for warp speeds.

* [`tower`]: A library of modular and reusable components for building robust networking clients and servers.

* [`tracing`] (formerly `tokio-trace`): A framework for application-level tracing and async-aware diagnostics.

* [`mio`]: A low-level, cross-platform abstraction over OS I/O APIs that powers `tokio`.

* [`bytes`]: Utilities for working with bytes, including efficient byte buffers.

* [`loom`]: A testing tool for concurrent Rust code.

[`axum`]: https://github.com/tokio-rs/axum
[`warp`]: https://github.com/seanmonstar/warp
[`hyper`]: https://github.com/hyperium/hyper
[`tonic`]: https://github.com/hyperium/tonic
[`tower`]: https://github.com/tower-rs/tower
[`loom`]: https://github.com/tokio-rs/loom
[`tracing`]: https://github.com/tokio-rs/tracing
[`mio`]: https://github.com/tokio-rs/mio
[`bytes`]: https://github.com/tokio-rs/bytes

## Changelog

The Tokio repository contains multiple crates. Each crate has its own changelog.

 * `tokio` - [view changelog](https://github.com/tokio-rs/tokio/blob/master/tokio/CHANGELOG.md)
 * `tokio-util` - [view changelog](https://github.com/tokio-rs/tokio/blob/master/tokio-util/CHANGELOG.md)
 * `tokio-stream` - [view changelog](https://github.com/tokio-rs/tokio/blob/master/tokio-stream/CHANGELOG.md)
 * `tokio-macros` - [view changelog](https://github.com/tokio-rs/tokio/blob/master/tokio-macros/CHANGELOG.md)
 * `tokio-test` - [view changelog](https://github.com/tokio-rs/tokio/blob/master/tokio-test/CHANGELOG.md)

## Supported Rust Versions

<!--
When updating this, also update:
- .github/workflows/ci.yml
- CONTRIBUTING.md
- README.md
- tokio/README.md
- tokio/Cargo.toml
- tokio-util/Cargo.toml
- tokio-test/Cargo.toml
- tokio-stream/Cargo.toml
-->

Tokio will keep a rolling MSRV (minimum supported rust version) policy of **at
least** 6 months. When increasing the MSRV, the new Rust version must have been
released at least six months ago. The current MSRV is 1.71.

Note that the MSRV is not increased automatically, and only as part of a minor
release. The MSRV history for past minor releases can be found below:

 * 1.48 to now  - Rust 1.71
 * 1.39 to 1.47 - Rust 1.70
 * 1.30 to 1.38 - Rust 1.63
 * 1.27 to 1.29 - Rust 1.56
 * 1.17 to 1.26 - Rust 1.49
 * 1.15 to 1.16 - Rust 1.46
 * 1.0 to 1.14 - Rust 1.45

Note that although we try to avoid the situation where a dependency transitively
increases the MSRV of Tokio, we do not guarantee that this does not happen.
However, every minor release will have some set of versions of dependencies that
works with the MSRV of that minor release.

## Release schedule

Tokio doesn't follow a fixed release schedule, but we typically make one minor
release each month. We make patch releases for bugfixes as necessary.

## Bug patching policy

For the purposes of making patch releases with bugfixes, we have designated
certain minor releases as LTS (long term support) releases. Whenever a bug
warrants a patch release with a fix for the bug, it will be backported and
released as a new patch release for each LTS minor version. Our current LTS
releases are:

 * `1.43.x` - LTS release until March 2026. (MSRV 1.70)
 * `1.47.x` - LTS release until September 2026. (MSRV 1.70)

Each LTS release will continue to receive backported fixes for at least a year.
If you wish to use a fixed minor release in your project, we recommend that you
use an LTS release.

To use a fixed minor version, you can specify the version with a tilde. For
example, to specify that you wish to use the newest `1.43.x` patch release, you
can use the following dependency specification:
```text
tokio = { version = "~1.43", features = [...] }
```

### Previous LTS releases

 * `1.8.x` - LTS release until February 2022.
 * `1.14.x` - LTS release until June 2022.
 * `1.18.x` - LTS release until June 2023.
 * `1.20.x` - LTS release until September 2023.
 * `1.25.x` - LTS release until March 2024.
 * `1.32.x` - LTS release until September 2024.
 * `1.36.x` - LTS release until March 2025.
 * `1.38.x` - LTS release until July 2025.

## License

This project is licensed under the [MIT license].

[MIT license]: https://github.com/tokio-rs/tokio/blob/master/LICENSE

### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Tokio by you shall be licensed as MIT, without any additional
terms or conditions.


================================================
FILE: SECURITY.md
================================================
## Report a security issue

The Tokio project team welcomes security reports and is committed to providing prompt attention to security issues. Security issues should be reported privately via [security@tokio.rs](mailto:security@tokio.rs). Security issues should not be reported via the public GitHub Issue tracker.

## Vulnerability coordination

Remediation of security vulnerabilities is prioritized by the project team. The project team coordinates remediation with third-party project stakeholders via [GitHub Security Advisories](https://help.github.com/en/github/managing-security-vulnerabilities/about-github-security-advisories). Third-party stakeholders may include the reporter of the issue, affected direct or indirect users of Tokio, and maintainers of upstream dependencies if applicable.

Downstream project maintainers and Tokio users can request participation in coordination of applicable security issues by sending your contact email address, GitHub username(s) and any other salient information to [security@tokio.rs](mailto:security@tokio.rs). Participation in security issue coordination processes is at the discretion of the Tokio team.

## Security advisories

The project team is committed to transparency in the security issue disclosure process. The Tokio team announces security issues via [project GitHub Release notes](https://github.com/tokio-rs/tokio/releases) and the [RustSec advisory database](https://github.com/RustSec/advisory-db) (i.e. `cargo-audit`).


================================================
FILE: benches/Cargo.toml
================================================
[package]
name = "benches"
version = "0.0.0"
publish = false
edition = "2021"
license = "MIT"

[features]
test-util = ["tokio/test-util"]

[dependencies]
tokio = { version = "1.5.0", path = "../tokio", features = ["full"] }
criterion = "0.5.1"
rand = "0.9"
rand_chacha = "0.9"

[dev-dependencies]
tokio-util = { version = "0.7.0", path = "../tokio-util", features = ["full"] }
tokio-stream = { version = "0.1", path = "../tokio-stream" }

[target.'cfg(unix)'.dependencies]
libc = "0.2.42"

[[bench]]
name = "spawn"
path = "spawn.rs"
harness = false

[[bench]]
name = "sync_broadcast"
path = "sync_broadcast.rs"
harness = false

[[bench]]
name = "sync_mpsc"
path = "sync_mpsc.rs"
harness = false

[[bench]]
name = "sync_mpsc_oneshot"
path = "sync_mpsc_oneshot.rs"
harness = false

[[bench]]
name = "sync_watch"
path = "sync_watch.rs"
harness = false

[[bench]]
name = "rt_current_thread"
path = "rt_current_thread.rs"
harness = false

[[bench]]
name = "rt_multi_threaded"
path = "rt_multi_threaded.rs"
harness = false

[[bench]]
name = "sync_notify"
path = "sync_notify.rs"
harness = false

[[bench]]
name = "sync_rwlock"
path = "sync_rwlock.rs"
harness = false

[[bench]]
name = "sync_semaphore"
path = "sync_semaphore.rs"
harness = false

[[bench]]
name = "signal"
path = "signal.rs"
harness = false

[[bench]]
name = "fs"
path = "fs.rs"
harness = false

[[bench]]
name = "copy"
path = "copy.rs"
harness = false

[[bench]]
name = "time_now"
path = "time_now.rs"
harness = false

[[bench]]
name = "time_timeout"
path = "time_timeout.rs"
harness = false

[[bench]]
name = "spawn_blocking"
path = "spawn_blocking.rs"
harness = false

[[bench]]
name = "remote_spawn"
path = "remote_spawn.rs"
harness = false

[lints]
workspace = true


================================================
FILE: benches/copy.rs
================================================
use criterion::{criterion_group, criterion_main, Criterion};

use rand::{Rng, SeedableRng};
use rand_chacha::ChaCha20Rng;

use tokio::io::{copy, repeat, AsyncRead, AsyncReadExt, AsyncWrite};
use tokio::time::{interval, Interval, MissedTickBehavior};

use std::task::Poll;
use std::time::Duration;

const KILO: usize = 1024;

// Tunable parameters if you want to change this benchmark. If reader and writer
// are matched in kilobytes per second, then this only exposes buffering to the
// benchmark.
const RNG_SEED: u64 = 0;
// How much data to copy in a single benchmark run
const SOURCE_SIZE: u64 = 256 * KILO as u64;
// Read side provides CHUNK_SIZE every READ_SERVICE_PERIOD. If it's not called
// frequently, it'll burst to catch up (representing OS buffers draining)
const CHUNK_SIZE: usize = 2 * KILO;
const READ_SERVICE_PERIOD: Duration = Duration::from_millis(1);
// Write side buffers up to WRITE_BUFFER, and flushes to disk every
// WRITE_SERVICE_PERIOD.
const WRITE_BUFFER: usize = 40 * KILO;
const WRITE_SERVICE_PERIOD: Duration = Duration::from_millis(20);
// How likely you are to have to wait for previously written data to be flushed
// because another writer claimed the buffer space
const PROBABILITY_FLUSH_WAIT: f64 = 0.1;

/// A slow writer that aims to simulate HDD behavior under heavy load.
///
/// There is a limited buffer, which is fully drained on the next write after
/// a time limit is reached. Flush waits for the time limit to be reached
/// and then drains the buffer.
///
/// At random, the HDD will stall writers while it flushes out all buffers. If
/// this happens to you, you will be unable to write until the next time the
/// buffer is drained.
struct SlowHddWriter {
    service_intervals: Interval,
    blocking_rng: ChaCha20Rng,
    buffer_size: usize,
    buffer_used: usize,
}

impl SlowHddWriter {
    fn new(service_interval: Duration, buffer_size: usize) -> Self {
        let blocking_rng = ChaCha20Rng::seed_from_u64(RNG_SEED);
        let mut service_intervals = interval(service_interval);
        service_intervals.set_missed_tick_behavior(MissedTickBehavior::Delay);
        Self {
            service_intervals,
            blocking_rng,
            buffer_size,
            buffer_used: 0,
        }
    }

    fn service_write(
        mut self: std::pin::Pin<&mut Self>,
        cx: &mut std::task::Context<'_>,
    ) -> std::task::Poll<Result<(), std::io::Error>> {
        // If we hit a service interval, the buffer can be cleared
        let res = self.service_intervals.poll_tick(cx).map(|_| Ok(()));
        if res.is_ready() {
            self.buffer_used = 0;
        }
        res
    }

    fn write_bytes(
        mut self: std::pin::Pin<&mut Self>,
        cx: &mut std::task::Context<'_>,
        writeable: usize,
    ) -> std::task::Poll<Result<usize, std::io::Error>> {
        let service_res = self.as_mut().service_write(cx);

        if service_res.is_pending() && self.blocking_rng.random_bool(PROBABILITY_FLUSH_WAIT) {
            return Poll::Pending;
        }
        let available = self.buffer_size - self.buffer_used;

        if available == 0 {
            assert!(service_res.is_pending());
            Poll::Pending
        } else {
            let written = available.min(writeable);
            self.buffer_used += written;
            Poll::Ready(Ok(written))
        }
    }
}

impl Unpin for SlowHddWriter {}

impl AsyncWrite for SlowHddWriter {
    fn poll_write(
        self: std::pin::Pin<&mut Self>,
        cx: &mut std::task::Context<'_>,
        buf: &[u8],
    ) -> std::task::Poll<Result<usize, std::io::Error>> {
        self.write_bytes(cx, buf.len())
    }

    fn poll_flush(
        self: std::pin::Pin<&mut Self>,
        cx: &mut std::task::Context<'_>,
    ) -> std::task::Poll<Result<(), std::io::Error>> {
        self.service_write(cx)
    }

    fn poll_shutdown(
        self: std::pin::Pin<&mut Self>,
        cx: &mut std::task::Context<'_>,
    ) -> std::task::Poll<Result<(), std::io::Error>> {
        self.service_write(cx)
    }

    fn poll_write_vectored(
        self: std::pin::Pin<&mut Self>,
        cx: &mut std::task::Context<'_>,
        bufs: &[std::io::IoSlice<'_>],
    ) -> std::task::Poll<Result<usize, std::io::Error>> {
        let writeable = bufs.iter().fold(0, |acc, buf| acc + buf.len());
        self.write_bytes(cx, writeable)
    }

    fn is_write_vectored(&self) -> bool {
        true
    }
}

/// A reader that limits the maximum chunk it'll give you back
///
/// Simulates something reading from a slow link - you get one chunk per call,
/// and you are offered chunks on a schedule
struct ChunkReader {
    data: Vec<u8>,
    service_intervals: Interval,
}

impl ChunkReader {
    fn new(chunk_size: usize, service_interval: Duration) -> Self {
        let mut service_intervals = interval(service_interval);
        service_intervals.set_missed_tick_behavior(MissedTickBehavior::Burst);
        let data: Vec<u8> = std::iter::repeat_n(0, chunk_size).collect();
        Self {
            data,
            service_intervals,
        }
    }
}

impl AsyncRead for ChunkReader {
    fn poll_read(
        mut self: std::pin::Pin<&mut Self>,
        cx: &mut std::task::Context<'_>,
        buf: &mut tokio::io::ReadBuf<'_>,
    ) -> Poll<std::io::Result<()>> {
        if self.service_intervals.poll_tick(cx).is_pending() {
            return Poll::Pending;
        }
        buf.put_slice(&self.data[..buf.remaining().min(self.data.len())]);
        Poll::Ready(Ok(()))
    }
}

fn rt() -> tokio::runtime::Runtime {
    tokio::runtime::Builder::new_current_thread()
        .enable_time()
        .build()
        .unwrap()
}

fn copy_mem_to_mem(c: &mut Criterion) {
    let rt = rt();

    c.bench_function("copy_mem_to_mem", |b| {
        b.iter(|| {
            let task = || async {
                let mut source = repeat(0).take(SOURCE_SIZE);
                let mut dest = Vec::new();
                copy(&mut source, &mut dest).await.unwrap();
            };

            rt.block_on(task());
        })
    });
}

fn copy_mem_to_slow_hdd(c: &mut Criterion) {
    let rt = rt();

    c.bench_function("copy_mem_to_slow_hdd", |b| {
        b.iter(|| {
            let task = || async {
                let mut source = repeat(0).take(SOURCE_SIZE);
                let mut dest = SlowHddWriter::new(WRITE_SERVICE_PERIOD, WRITE_BUFFER);
                copy(&mut source, &mut dest).await.unwrap();
            };

            rt.block_on(task());
        })
    });
}

fn copy_chunk_to_mem(c: &mut Criterion) {
    let rt = rt();

    c.bench_function("copy_chunk_to_mem", |b| {
        b.iter(|| {
            let task = || async {
                let mut source =
                    ChunkReader::new(CHUNK_SIZE, READ_SERVICE_PERIOD).take(SOURCE_SIZE);
                let mut dest = Vec::new();
                copy(&mut source, &mut dest).await.unwrap();
            };

            rt.block_on(task());
        })
    });
}

fn copy_chunk_to_slow_hdd(c: &mut Criterion) {
    let rt = rt();

    c.bench_function("copy_chunk_to_slow_hdd", |b| {
        b.iter(|| {
            let task = || async {
                let mut source =
                    ChunkReader::new(CHUNK_SIZE, READ_SERVICE_PERIOD).take(SOURCE_SIZE);
                let mut dest = SlowHddWriter::new(WRITE_SERVICE_PERIOD, WRITE_BUFFER);
                copy(&mut source, &mut dest).await.unwrap();
            };

            rt.block_on(task());
        })
    });
}

criterion_group!(
    copy_bench,
    copy_mem_to_mem,
    copy_mem_to_slow_hdd,
    copy_chunk_to_mem,
    copy_chunk_to_slow_hdd,
);
criterion_main!(copy_bench);


================================================
FILE: benches/fs.rs
================================================
#![cfg(unix)]

use tokio_stream::StreamExt;

use tokio::fs::File;
use tokio::io::AsyncReadExt;
use tokio_util::codec::{BytesCodec, FramedRead /*FramedWrite*/};

use criterion::{criterion_group, criterion_main, Criterion};

use std::fs::File as StdFile;
use std::io::Read as StdRead;

fn rt() -> tokio::runtime::Runtime {
    tokio::runtime::Builder::new_multi_thread()
        .worker_threads(2)
        .build()
        .unwrap()
}

const BLOCK_COUNT: usize = 1_000;

const BUFFER_SIZE: usize = 4096;
const DEV_ZERO: &str = "/dev/zero";

fn async_read_codec(c: &mut Criterion) {
    let rt = rt();

    c.bench_function("async_read_codec", |b| {
        b.iter(|| {
            let task = || async {
                let file = File::open(DEV_ZERO).await.unwrap();
                let mut input_stream =
                    FramedRead::with_capacity(file, BytesCodec::new(), BUFFER_SIZE);

                for _i in 0..BLOCK_COUNT {
                    let _bytes = input_stream.next().await.unwrap();
                }
            };

            rt.block_on(task());
        })
    });
}

fn async_read_buf(c: &mut Criterion) {
    let rt = rt();

    c.bench_function("async_read_buf", |b| {
        b.iter(|| {
            let task = || async {
                let mut file = File::open(DEV_ZERO).await.unwrap();
                let mut buffer = [0u8; BUFFER_SIZE];

                for _i in 0..BLOCK_COUNT {
                    let count = file.read(&mut buffer).await.unwrap();
                    if count == 0 {
                        break;
                    }
                }
            };

            rt.block_on(task());
        });
    });
}

fn async_read_std_file(c: &mut Criterion) {
    let rt = rt();

    c.bench_function("async_read_std_file", |b| {
        b.iter(|| {
            let task = || async {
                let mut file =
                    tokio::task::block_in_place(|| Box::pin(StdFile::open(DEV_ZERO).unwrap()));

                for _i in 0..BLOCK_COUNT {
                    let mut buffer = [0u8; BUFFER_SIZE];
                    let mut file_ref = file.as_mut();

                    tokio::task::block_in_place(move || {
                        file_ref.read_exact(&mut buffer).unwrap();
                    });
                }
            };

            rt.block_on(task());
        });
    });
}

fn sync_read(c: &mut Criterion) {
    c.bench_function("sync_read", |b| {
        b.iter(|| {
            let mut file = StdFile::open(DEV_ZERO).unwrap();
            let mut buffer = [0u8; BUFFER_SIZE];

            for _i in 0..BLOCK_COUNT {
                file.read_exact(&mut buffer).unwrap();
            }
        })
    });
}

criterion_group!(
    file,
    async_read_std_file,
    async_read_buf,
    async_read_codec,
    sync_read
);
criterion_main!(file);


================================================
FILE: benches/remote_spawn.rs
================================================
//! Benchmark remote task spawning (push_remote_task) at different concurrency
//! levels on the multi-threaded scheduler.
//!
//! This measures contention on the scheduler's inject queue mutex when multiple
//! external (non-worker) threads spawn tasks into the tokio runtime simultaneously.
//! Every rt.spawn() from an external thread unconditionally goes through
//! push_remote_task, making this a direct measurement of inject queue contention.
//!
//! For each parallelism level N (1, 2, 4, 8, 16, 32, 64, capped at available parallelism):
//! - Spawns N std::threads (external to the runtime)
//! - Each thread spawns TOTAL_TASKS / N tasks into the runtime via rt.spawn()
//! - All threads are synchronized with a barrier to maximize contention
//! - Tasks are trivial no-ops to isolate the push overhead

use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
use std::sync::Barrier;
use tokio::runtime::{self, Runtime};

/// Total number of tasks spawned across all threads per iteration.
/// Must be divisible by the largest parallelism level (64).
const TOTAL_TASKS: usize = 12_800;
const _: () = assert!(TOTAL_TASKS % 64 == 0, "TOTAL_TASKS must be divisible by 64");

fn remote_spawn_contention(c: &mut Criterion) {
    let parallelism_levels = parallelism_levels();
    let mut group = c.benchmark_group("remote_spawn");

    for num_threads in &parallelism_levels {
        let num_threads = *num_threads;
        group.bench_with_input(
            BenchmarkId::new("threads", num_threads),
            &num_threads,
            |b, &num_threads| {
                let rt = rt();
                let tasks_per_thread = TOTAL_TASKS / num_threads;
                let barrier = Barrier::new(num_threads);

                b.iter_custom(|iters| {
                    let mut total_duration = std::time::Duration::ZERO;
                    for _ in 0..iters {
                        let start = std::time::Instant::now();

                        let all_handles = std::thread::scope(|s| {
                            let handles: Vec<_> = (0..num_threads)
                                .map(|_| {
                                    let barrier = &barrier;
                                    let rt = &rt;
                                    s.spawn(move || {
                                        let mut join_handles = Vec::with_capacity(tasks_per_thread);
                                        barrier.wait();

                                        for _ in 0..tasks_per_thread {
                                            join_handles.push(rt.spawn(async {}));
                                        }
                                        join_handles
                                    })
                                })
                                .collect();

                            handles
                                .into_iter()
                                .flat_map(|h| h.join().unwrap())
                                .collect::<Vec<_>>()
                        });

                        total_duration += start.elapsed();

                        rt.block_on(async {
                            for h in all_handles {
                                h.await.unwrap();
                            }
                        });
                    }
                    total_duration
                });
            },
        );
    }

    group.finish();
}

fn parallelism_levels() -> Vec<usize> {
    let max_parallelism = std::thread::available_parallelism()
        .map(|p| p.get())
        .unwrap_or(1);

    [1, 2, 4, 8, 16, 32, 64]
        .into_iter()
        .filter(|&n| n <= max_parallelism)
        .collect()
}

fn rt() -> Runtime {
    runtime::Builder::new_multi_thread().build().unwrap()
}

criterion_group!(remote_spawn_benches, remote_spawn_contention);

criterion_main!(remote_spawn_benches);


================================================
FILE: benches/rt_current_thread.rs
================================================
//! Benchmark implementation details of the threaded scheduler. These benches are
//! intended to be used as a form of regression testing and not as a general
//! purpose benchmark demonstrating real-world performance.

use tokio::runtime::{self, Runtime};

use criterion::{criterion_group, criterion_main, Criterion};

const NUM_SPAWN: usize = 1_000;

fn rt_curr_spawn_many_local(c: &mut Criterion) {
    let rt = rt();
    let mut handles = Vec::with_capacity(NUM_SPAWN);

    c.bench_function("spawn_many_local", |b| {
        b.iter(|| {
            rt.block_on(async {
                for _ in 0..NUM_SPAWN {
                    handles.push(tokio::spawn(async move {}));
                }

                for handle in handles.drain(..) {
                    handle.await.unwrap();
                }
            });
        })
    });
}

fn rt_curr_spawn_many_remote_idle(c: &mut Criterion) {
    let rt = rt();
    let rt_handle = rt.handle();
    let mut handles = Vec::with_capacity(NUM_SPAWN);

    c.bench_function("spawn_many_remote_idle", |b| {
        b.iter(|| {
            for _ in 0..NUM_SPAWN {
                handles.push(rt_handle.spawn(async {}));
            }

            rt.block_on(async {
                for handle in handles.drain(..) {
                    handle.await.unwrap();
                }
            });
        })
    });
}

fn rt_curr_spawn_many_remote_busy(c: &mut Criterion) {
    let rt = rt();
    let rt_handle = rt.handle();
    let mut handles = Vec::with_capacity(NUM_SPAWN);

    rt.spawn(async {
        fn iter() {
            tokio::spawn(async { iter() });
        }

        iter()
    });

    c.bench_function("spawn_many_remote_busy", |b| {
        b.iter(|| {
            for _ in 0..NUM_SPAWN {
                handles.push(rt_handle.spawn(async {}));
            }

            rt.block_on(async {
                for handle in handles.drain(..) {
                    handle.await.unwrap();
                }
            });
        })
    });
}

fn rt() -> Runtime {
    runtime::Builder::new_current_thread().build().unwrap()
}

criterion_group!(
    rt_curr_scheduler,
    rt_curr_spawn_many_local,
    rt_curr_spawn_many_remote_idle,
    rt_curr_spawn_many_remote_busy
);

criterion_main!(rt_curr_scheduler);


================================================
FILE: benches/rt_multi_threaded.rs
================================================
//! Benchmark implementation details of the threaded scheduler. These benches are
//! intended to be used as a form of regression testing and not as a general
//! purpose benchmark demonstrating real-world performance.

use tokio::runtime::{self, Runtime};
use tokio::sync::oneshot;

use std::sync::atomic::Ordering::Relaxed;
use std::sync::atomic::{AtomicBool, AtomicUsize};
use std::sync::{mpsc, Arc};
use std::time::{Duration, Instant};

use criterion::{criterion_group, criterion_main, Criterion};

const NUM_WORKERS: usize = 4;
const NUM_SPAWN: usize = 10_000;
const STALL_DUR: Duration = Duration::from_micros(10);

fn rt_multi_spawn_many_local(c: &mut Criterion) {
    let rt = rt();

    let (tx, rx) = mpsc::sync_channel(1000);
    let rem = Arc::new(AtomicUsize::new(0));

    c.bench_function("spawn_many_local", |b| {
        b.iter(|| {
            rem.store(NUM_SPAWN, Relaxed);

            rt.block_on(async {
                for _ in 0..NUM_SPAWN {
                    let tx = tx.clone();
                    let rem = rem.clone();

                    tokio::spawn(async move {
                        if 1 == rem.fetch_sub(1, Relaxed) {
                            tx.send(()).unwrap();
                        }
                    });
                }

                rx.recv().unwrap();
            });
        })
    });
}

fn rt_multi_spawn_many_remote_idle(c: &mut Criterion) {
    let rt = rt();

    let mut handles = Vec::with_capacity(NUM_SPAWN);

    c.bench_function("spawn_many_remote_idle", |b| {
        b.iter(|| {
            for _ in 0..NUM_SPAWN {
                handles.push(rt.spawn(async {}));
            }

            rt.block_on(async {
                for handle in handles.drain(..) {
                    handle.await.unwrap();
                }
            });
        })
    });
}

// The runtime is busy with tasks that consume CPU time and yield. Yielding is a
// lower notification priority than spawning / regular notification.
fn rt_multi_spawn_many_remote_busy1(c: &mut Criterion) {
    let rt = rt();
    let rt_handle = rt.handle();
    let mut handles = Vec::with_capacity(NUM_SPAWN);
    let flag = Arc::new(AtomicBool::new(true));

    // Spawn some tasks to keep the runtimes busy
    for _ in 0..(2 * NUM_WORKERS) {
        let flag = flag.clone();
        rt.spawn(async move {
            while flag.load(Relaxed) {
                tokio::task::yield_now().await;
                stall();
            }
        });
    }

    c.bench_function("spawn_many_remote_busy1", |b| {
        b.iter(|| {
            for _ in 0..NUM_SPAWN {
                handles.push(rt_handle.spawn(async {}));
            }

            rt.block_on(async {
                for handle in handles.drain(..) {
                    handle.await.unwrap();
                }
            });
        })
    });

    flag.store(false, Relaxed);
}

// The runtime is busy with tasks that consume CPU time and spawn new high-CPU
// tasks. Spawning goes via a higher notification priority than yielding.
fn rt_multi_spawn_many_remote_busy2(c: &mut Criterion) {
    const NUM_SPAWN: usize = 1_000;

    let rt = rt();
    let rt_handle = rt.handle();
    let mut handles = Vec::with_capacity(NUM_SPAWN);
    let flag = Arc::new(AtomicBool::new(true));

    // Spawn some tasks to keep the runtimes busy
    for _ in 0..(NUM_WORKERS) {
        let flag = flag.clone();
        fn iter(flag: Arc<AtomicBool>) {
            tokio::spawn(async {
                if flag.load(Relaxed) {
                    stall();
                    iter(flag);
                }
            });
        }
        rt.spawn(async {
            iter(flag);
        });
    }

    c.bench_function("spawn_many_remote_busy2", |b| {
        b.iter(|| {
            for _ in 0..NUM_SPAWN {
                handles.push(rt_handle.spawn(async {}));
            }

            rt.block_on(async {
                for handle in handles.drain(..) {
                    handle.await.unwrap();
                }
            });
        })
    });

    flag.store(false, Relaxed);
}

fn rt_multi_yield_many(c: &mut Criterion) {
    const NUM_YIELD: usize = 1_000;
    const TASKS: usize = 200;

    c.bench_function("yield_many", |b| {
        let rt = rt();
        let (tx, rx) = mpsc::sync_channel(TASKS);

        b.iter(move || {
            for _ in 0..TASKS {
                let tx = tx.clone();

                rt.spawn(async move {
                    for _ in 0..NUM_YIELD {
                        tokio::task::yield_now().await;
                    }

                    tx.send(()).unwrap();
                });
            }

            for _ in 0..TASKS {
                rx.recv().unwrap();
            }
        })
    });
}

fn rt_multi_ping_pong(c: &mut Criterion) {
    const NUM_PINGS: usize = 1_000;

    let rt = rt();

    let (done_tx, done_rx) = mpsc::sync_channel(1000);
    let rem = Arc::new(AtomicUsize::new(0));

    c.bench_function("ping_pong", |b| {
        b.iter(|| {
            let done_tx = done_tx.clone();
            let rem = rem.clone();
            rem.store(NUM_PINGS, Relaxed);

            rt.block_on(async {
                tokio::spawn(async move {
                    for _ in 0..NUM_PINGS {
                        let rem = rem.clone();
                        let done_tx = done_tx.clone();

                        tokio::spawn(async move {
                            let (tx1, rx1) = oneshot::channel();
                            let (tx2, rx2) = oneshot::channel();

                            tokio::spawn(async move {
                                rx1.await.unwrap();
                                tx2.send(()).unwrap();
                            });

                            tx1.send(()).unwrap();
                            rx2.await.unwrap();

                            if 1 == rem.fetch_sub(1, Relaxed) {
                                done_tx.send(()).unwrap();
                            }
                        });
                    }
                });

                done_rx.recv().unwrap();
            });
        })
    });
}

fn rt_multi_chained_spawn(c: &mut Criterion) {
    const ITER: usize = 1_000;

    fn iter(done_tx: mpsc::SyncSender<()>, n: usize) {
        if n == 0 {
            done_tx.send(()).unwrap();
        } else {
            tokio::spawn(async move {
                iter(done_tx, n - 1);
            });
        }
    }

    c.bench_function("chained_spawn", |b| {
        let rt = rt();
        let (done_tx, done_rx) = mpsc::sync_channel(1000);

        b.iter(move || {
            let done_tx = done_tx.clone();

            rt.block_on(async {
                tokio::spawn(async move {
                    iter(done_tx, ITER);
                });

                done_rx.recv().unwrap();
            });
        })
    });
}

fn rt() -> Runtime {
    runtime::Builder::new_multi_thread()
        .worker_threads(NUM_WORKERS)
        .enable_all()
        .build()
        .unwrap()
}

fn stall() {
    let now = Instant::now();
    while now.elapsed() < STALL_DUR {
        std::thread::yield_now();
    }
}

criterion_group!(
    rt_multi_scheduler,
    rt_multi_spawn_many_local,
    rt_multi_spawn_many_remote_idle,
    rt_multi_spawn_many_remote_busy1,
    rt_multi_spawn_many_remote_busy2,
    rt_multi_ping_pong,
    rt_multi_yield_many,
    rt_multi_chained_spawn,
);

criterion_main!(rt_multi_scheduler);


================================================
FILE: benches/signal.rs
================================================
//! Benchmark the delay in propagating OS signals to any listeners.
#![cfg(unix)]

use criterion::{criterion_group, criterion_main, Criterion};
use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};
use tokio::runtime;
use tokio::signal::unix::{signal, SignalKind};
use tokio::sync::mpsc;

struct Spinner {
    count: usize,
}

impl Future for Spinner {
    type Output = ();

    fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
        if self.count > 3 {
            Poll::Ready(())
        } else {
            self.count += 1;
            cx.waker().wake_by_ref();
            Poll::Pending
        }
    }
}

impl Spinner {
    fn new() -> Self {
        Self { count: 0 }
    }
}

pub fn send_signal(signal: libc::c_int) {
    use libc::{getpid, kill};

    unsafe {
        assert_eq!(kill(getpid(), signal), 0);
    }
}

fn many_signals(c: &mut Criterion) {
    let num_signals = 10;
    let (tx, mut rx) = mpsc::channel(num_signals);

    // Intentionally single threaded to measure delays in propagating wakes
    let rt = runtime::Builder::new_current_thread()
        .enable_all()
        .build()
        .unwrap();

    let spawn_signal = |kind| {
        let tx = tx.clone();
        rt.spawn(async move {
            let mut signal = signal(kind).expect("failed to create signal");

            while signal.recv().await.is_some() {
                if tx.send(()).await.is_err() {
                    break;
                }
            }
        });
    };

    for _ in 0..num_signals {
        // Pick some random signals which don't terminate the test harness
        spawn_signal(SignalKind::child());
        spawn_signal(SignalKind::io());
    }
    drop(tx);

    // Turn the runtime for a while to ensure that all the spawned
    // tasks have been polled at least once
    rt.block_on(Spinner::new());

    c.bench_function("many_signals", |b| {
        b.iter(|| {
            rt.block_on(async {
                send_signal(libc::SIGCHLD);
                for _ in 0..num_signals {
                    rx.recv().await.expect("channel closed");
                }

                send_signal(libc::SIGIO);
                for _ in 0..num_signals {
                    rx.recv().await.expect("channel closed");
                }
            });
        })
    });
}

criterion_group!(signal_group, many_signals);

criterion_main!(signal_group);


================================================
FILE: benches/spawn.rs
================================================
//! Benchmark spawning a task onto the basic and threaded Tokio executors.
//! This essentially measure the time to enqueue a task in the local and remote
//! case.

use criterion::{black_box, criterion_group, criterion_main, Criterion};

async fn work() -> usize {
    let val = 1 + 1;
    tokio::task::yield_now().await;
    black_box(val)
}

fn single_rt() -> tokio::runtime::Runtime {
    tokio::runtime::Builder::new_current_thread()
        .build()
        .unwrap()
}

fn multi_rt() -> tokio::runtime::Runtime {
    tokio::runtime::Builder::new_multi_thread()
        .worker_threads(1)
        .build()
        .unwrap()
}

fn basic_scheduler_spawn(c: &mut Criterion) {
    let runtime = single_rt();

    c.bench_function("basic_scheduler_spawn", |b| {
        b.iter(|| {
            runtime.block_on(async {
                let h = tokio::spawn(work());
                assert_eq!(h.await.unwrap(), 2);
            });
        })
    });
}

fn basic_scheduler_spawn10(c: &mut Criterion) {
    let runtime = single_rt();

    c.bench_function("basic_scheduler_spawn10", |b| {
        b.iter(|| {
            runtime.block_on(async {
                let mut handles = Vec::with_capacity(10);
                for _ in 0..10 {
                    handles.push(tokio::spawn(work()));
                }
                for handle in handles {
                    assert_eq!(handle.await.unwrap(), 2);
                }
            });
        })
    });
}

fn threaded_scheduler_spawn(c: &mut Criterion) {
    let runtime = multi_rt();

    c.bench_function("threaded_scheduler_spawn", |b| {
        b.iter(|| {
            runtime.block_on(async {
                let h = tokio::spawn(work());
                assert_eq!(h.await.unwrap(), 2);
            });
        })
    });
}

fn threaded_scheduler_spawn10(c: &mut Criterion) {
    let runtime = multi_rt();

    c.bench_function("threaded_scheduler_spawn10", |b| {
        b.iter(|| {
            runtime.block_on(async {
                let mut handles = Vec::with_capacity(10);
                for _ in 0..10 {
                    handles.push(tokio::spawn(work()));
                }
                for handle in handles {
                    assert_eq!(handle.await.unwrap(), 2);
                }
            });
        })
    });
}

criterion_group!(
    spawn,
    basic_scheduler_spawn,
    basic_scheduler_spawn10,
    threaded_scheduler_spawn,
    threaded_scheduler_spawn10,
);

criterion_main!(spawn);


================================================
FILE: benches/spawn_blocking.rs
================================================
//! Benchmark spawn_blocking at different concurrency levels on the multi-threaded scheduler.
//!
//! For each parallelism level N (1, 2, 4, 8, 16, 32, 64, capped at available parallelism):
//! - Spawns N regular async tasks
//! - Each task spawns M batches of B spawn_blocking tasks (no-ops)
//! - Each batch is awaited to completion before starting the next

use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion};
use tokio::runtime::{self, Runtime};
use tokio::task::JoinSet;

/// Number of batches per task
const NUM_BATCHES: usize = 100;
/// Number of spawn_blocking calls per batch
const BATCH_SIZE: usize = 16;

fn spawn_blocking_concurrency(c: &mut Criterion) {
    let max_parallelism = std::thread::available_parallelism()
        .map(|p| p.get())
        .unwrap_or(1);

    let parallelism_levels: Vec<usize> = [1, 2, 4, 8, 16, 32, 64]
        .into_iter()
        .filter(|&n| n <= max_parallelism)
        .collect();

    let mut group = c.benchmark_group("spawn_blocking");

    for num_tasks in parallelism_levels {
        group.bench_with_input(
            BenchmarkId::new("concurrency", num_tasks),
            &num_tasks,
            |b, &num_tasks| {
                let rt = rt();

                b.iter(|| {
                    rt.block_on(async {
                        let mut tasks = JoinSet::new();

                        for _ in 0..num_tasks {
                            tasks.spawn(async {
                                for _ in 0..NUM_BATCHES {
                                    let mut batch = JoinSet::new();

                                    for _ in 0..BATCH_SIZE {
                                        batch.spawn_blocking(|| black_box(0));
                                    }

                                    batch.join_all().await;
                                }
                            });
                        }

                        tasks.join_all().await;
                    });
                });
            },
        );
    }

    group.finish();
}

fn rt() -> Runtime {
    runtime::Builder::new_multi_thread()
        .enable_all()
        .build()
        .unwrap()
}

criterion_group!(spawn_blocking_benches, spawn_blocking_concurrency);

criterion_main!(spawn_blocking_benches);


================================================
FILE: benches/sync_broadcast.rs
================================================
use rand::{Rng, RngCore, SeedableRng};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use tokio::sync::{broadcast, Notify};

use criterion::measurement::WallTime;
use criterion::{black_box, criterion_group, criterion_main, BenchmarkGroup, Criterion};

fn rt() -> tokio::runtime::Runtime {
    tokio::runtime::Builder::new_multi_thread()
        .worker_threads(6)
        .build()
        .unwrap()
}

fn do_work(rng: &mut impl RngCore) -> u32 {
    use std::fmt::Write;
    let mut message = String::new();
    for i in 1..=10 {
        let _ = write!(&mut message, " {i}={}", rng.random::<f64>());
    }
    message
        .as_bytes()
        .iter()
        .map(|&c| c as u32)
        .fold(0, u32::wrapping_add)
}

fn contention_impl<const N_TASKS: usize>(g: &mut BenchmarkGroup<WallTime>) {
    let rt = rt();

    let (tx, _rx) = broadcast::channel::<usize>(1000);
    let wg = Arc::new((AtomicUsize::new(0), Notify::new()));

    for n in 0..N_TASKS {
        let wg = wg.clone();
        let mut rx = tx.subscribe();
        let mut rng = rand::rngs::StdRng::seed_from_u64(n as u64);
        rt.spawn(async move {
            while (rx.recv().await).is_ok() {
                let r = do_work(&mut rng);
                let _ = black_box(r);
                if wg.0.fetch_sub(1, Ordering::Relaxed) == 1 {
                    wg.1.notify_one();
                }
            }
        });
    }

    const N_ITERS: usize = 100;

    g.bench_function(N_TASKS.to_string(), |b| {
        b.iter(|| {
            rt.block_on({
                let wg = wg.clone();
                let tx = tx.clone();
                async move {
                    for i in 0..N_ITERS {
                        assert_eq!(wg.0.fetch_add(N_TASKS, Ordering::Relaxed), 0);
                        tx.send(i).unwrap();
                        while wg.0.load(Ordering::Relaxed) > 0 {
                            wg.1.notified().await;
                        }
                    }
                }
            })
        })
    });
}

fn bench_contention(c: &mut Criterion) {
    let mut group = c.benchmark_group("contention");
    contention_impl::<10>(&mut group);
    contention_impl::<100>(&mut group);
    contention_impl::<500>(&mut group);
    contention_impl::<1000>(&mut group);
    group.finish();
}

criterion_group!(contention, bench_contention);

criterion_main!(contention);


================================================
FILE: benches/sync_mpsc.rs
================================================
use tokio::sync::mpsc;

use criterion::measurement::WallTime;
use criterion::{black_box, criterion_group, criterion_main, BenchmarkGroup, Criterion};

#[derive(Debug, Copy, Clone)]
struct Medium(#[allow(dead_code)] [usize; 64]);
impl Default for Medium {
    fn default() -> Self {
        Medium([0; 64])
    }
}

#[derive(Debug, Copy, Clone)]
struct Large(#[allow(dead_code)] [Medium; 64]);
impl Default for Large {
    fn default() -> Self {
        Large([Medium::default(); 64])
    }
}

fn rt() -> tokio::runtime::Runtime {
    tokio::runtime::Builder::new_multi_thread()
        .worker_threads(6)
        .build()
        .unwrap()
}

fn create_medium<const SIZE: usize>(g: &mut BenchmarkGroup<WallTime>) {
    g.bench_function(SIZE.to_string(), |b| {
        b.iter(|| {
            black_box(&mpsc::channel::<Medium>(SIZE));
        })
    });
}

fn send_data<T: Default, const SIZE: usize>(g: &mut BenchmarkGroup<WallTime>, prefix: &str) {
    let rt = rt();

    g.bench_function(format!("{prefix}_{SIZE}"), |b| {
        b.iter(|| {
            let (tx, mut rx) = mpsc::channel::<T>(SIZE);

            let _ = rt.block_on(tx.send(T::default()));

            rt.block_on(rx.recv()).unwrap();
        })
    });
}

fn contention_bounded(g: &mut BenchmarkGroup<WallTime>) {
    let rt = rt();

    g.bench_function("bounded", |b| {
        b.iter(|| {
            rt.block_on(async move {
                let (tx, mut rx) = mpsc::channel::<usize>(1_000_000);

                for _ in 0..5 {
                    let tx = tx.clone();
                    tokio::spawn(async move {
                        for i in 0..1000 {
                            tx.send(i).await.unwrap();
                        }
                    });
                }

                for _ in 0..1_000 * 5 {
                    let _ = rx.recv().await;
                }
            })
        })
    });
}

fn contention_bounded_recv_many(g: &mut BenchmarkGroup<WallTime>) {
    let rt = rt();

    g.bench_function("bounded_recv_many", |b| {
        b.iter(|| {
            rt.block_on(async move {
                let (tx, mut rx) = mpsc::channel::<usize>(1_000_000);

                for _ in 0..5 {
                    let tx = tx.clone();
                    tokio::spawn(async move {
                        for i in 0..1000 {
                            tx.send(i).await.unwrap();
                        }
                    });
                }

                let mut buffer = Vec::<usize>::with_capacity(5_000);
                let mut total = 0;
                while total < 1_000 * 5 {
                    total += rx.recv_many(&mut buffer, 5_000).await;
                }
            })
        })
    });
}

fn contention_bounded_full(g: &mut BenchmarkGroup<WallTime>) {
    let rt = rt();

    g.bench_function("bounded_full", |b| {
        b.iter(|| {
            rt.block_on(async move {
                let (tx, mut rx) = mpsc::channel::<usize>(100);

                for _ in 0..5 {
                    let tx = tx.clone();
                    tokio::spawn(async move {
                        for i in 0..1000 {
                            tx.send(i).await.unwrap();
                        }
                    });
                }

                for _ in 0..1_000 * 5 {
                    let _ = rx.recv().await;
                }
            })
        })
    });
}

fn contention_bounded_full_recv_many(g: &mut BenchmarkGroup<WallTime>) {
    let rt = rt();

    g.bench_function("bounded_full_recv_many", |b| {
        b.iter(|| {
            rt.block_on(async move {
                let (tx, mut rx) = mpsc::channel::<usize>(100);

                for _ in 0..5 {
                    let tx = tx.clone();
                    tokio::spawn(async move {
                        for i in 0..1000 {
                            tx.send(i).await.unwrap();
                        }
                    });
                }

                let mut buffer = Vec::<usize>::with_capacity(5_000);
                let mut total = 0;
                while total < 1_000 * 5 {
                    total += rx.recv_many(&mut buffer, 5_000).await;
                }
            })
        })
    });
}

fn contention_unbounded(g: &mut BenchmarkGroup<WallTime>) {
    let rt = rt();

    g.bench_function("unbounded", |b| {
        b.iter(|| {
            rt.block_on(async move {
                let (tx, mut rx) = mpsc::unbounded_channel::<usize>();

                for _ in 0..5 {
                    let tx = tx.clone();
                    tokio::spawn(async move {
                        for i in 0..1000 {
                            tx.send(i).unwrap();
                        }
                    });
                }

                for _ in 0..1_000 * 5 {
                    let _ = rx.recv().await;
                }
            })
        })
    });
}

fn contention_unbounded_recv_many(g: &mut BenchmarkGroup<WallTime>) {
    let rt = rt();

    g.bench_function("unbounded_recv_many", |b| {
        b.iter(|| {
            rt.block_on(async move {
                let (tx, mut rx) = mpsc::unbounded_channel::<usize>();

                for _ in 0..5 {
                    let tx = tx.clone();
                    tokio::spawn(async move {
                        for i in 0..1000 {
                            tx.send(i).unwrap();
                        }
                    });
                }

                let mut buffer = Vec::<usize>::with_capacity(5_000);
                let mut total = 0;
                while total < 1_000 * 5 {
                    total += rx.recv_many(&mut buffer, 5_000).await;
                }
            })
        })
    });
}

fn uncontented_bounded(g: &mut BenchmarkGroup<WallTime>) {
    let rt = rt();

    g.bench_function("bounded", |b| {
        b.iter(|| {
            rt.block_on(async move {
                let (tx, mut rx) = mpsc::channel::<usize>(1_000_000);

                for i in 0..5000 {
                    tx.send(i).await.unwrap();
                }

                for _ in 0..5_000 {
                    let _ = rx.recv().await;
                }
            })
        })
    });
}

fn uncontented_bounded_recv_many(g: &mut BenchmarkGroup<WallTime>) {
    let rt = rt();

    g.bench_function("bounded_recv_many", |b| {
        b.iter(|| {
            rt.block_on(async move {
                let (tx, mut rx) = mpsc::channel::<usize>(1_000_000);

                for i in 0..5000 {
                    tx.send(i).await.unwrap();
                }

                let mut buffer = Vec::<usize>::with_capacity(5_000);
                let mut total = 0;
                while total < 1_000 * 5 {
                    total += rx.recv_many(&mut buffer, 5_000).await;
                }
            })
        })
    });
}

fn uncontented_unbounded(g: &mut BenchmarkGroup<WallTime>) {
    let rt = rt();

    g.bench_function("unbounded", |b| {
        b.iter(|| {
            rt.block_on(async move {
                let (tx, mut rx) = mpsc::unbounded_channel::<usize>();

                for i in 0..5000 {
                    tx.send(i).unwrap();
                }

                for _ in 0..5_000 {
                    let _ = rx.recv().await;
                }
            })
        })
    });
}

fn uncontented_unbounded_recv_many(g: &mut BenchmarkGroup<WallTime>) {
    let rt = rt();

    g.bench_function("unbounded_recv_many", |b| {
        b.iter(|| {
            rt.block_on(async move {
                let (tx, mut rx) = mpsc::unbounded_channel::<usize>();

                for i in 0..5000 {
                    tx.send(i).unwrap();
                }

                let mut buffer = Vec::<usize>::with_capacity(5_000);
                let mut total = 0;
                while total < 1_000 * 5 {
                    total += rx.recv_many(&mut buffer, 5_000).await;
                }
            })
        })
    });
}

fn bench_create_medium(c: &mut Criterion) {
    let mut group = c.benchmark_group("create_medium");
    create_medium::<1>(&mut group);
    create_medium::<100>(&mut group);
    create_medium::<100_000>(&mut group);
    group.finish();
}

fn bench_send(c: &mut Criterion) {
    let mut group = c.benchmark_group("send");
    send_data::<Medium, 1000>(&mut group, "medium");
    send_data::<Large, 1000>(&mut group, "large");
    group.finish();
}

fn bench_contention(c: &mut Criterion) {
    let mut group = c.benchmark_group("contention");
    contention_bounded(&mut group);
    contention_bounded_recv_many(&mut group);
    contention_bounded_full(&mut group);
    contention_bounded_full_recv_many(&mut group);
    contention_unbounded(&mut group);
    contention_unbounded_recv_many(&mut group);
    group.finish();
}

fn bench_uncontented(c: &mut Criterion) {
    let mut group = c.benchmark_group("uncontented");
    uncontented_bounded(&mut group);
    uncontented_bounded_recv_many(&mut group);
    uncontented_unbounded(&mut group);
    uncontented_unbounded_recv_many(&mut group);
    group.finish();
}

criterion_group!(create, bench_create_medium);
criterion_group!(send, bench_send);
criterion_group!(contention, bench_contention);
criterion_group!(uncontented, bench_uncontented);

criterion_main!(create, send, contention, uncontented);


================================================
FILE: benches/sync_mpsc_oneshot.rs
================================================
use tokio::{
    runtime::Runtime,
    sync::{mpsc, oneshot},
};

use criterion::{criterion_group, criterion_main, Criterion};

fn request_reply_current_thread(c: &mut Criterion) {
    let rt = tokio::runtime::Builder::new_current_thread()
        .build()
        .unwrap();

    request_reply(c, rt);
}

fn request_reply_multi_threaded(c: &mut Criterion) {
    let rt = tokio::runtime::Builder::new_multi_thread()
        .worker_threads(1)
        .build()
        .unwrap();

    request_reply(c, rt);
}

fn request_reply(b: &mut Criterion, rt: Runtime) {
    let tx = rt.block_on(async move {
        let (tx, mut rx) = mpsc::channel::<oneshot::Sender<()>>(10);
        tokio::spawn(async move {
            while let Some(reply) = rx.recv().await {
                reply.send(()).unwrap();
            }
        });
        tx
    });

    b.bench_function("request_reply", |b| {
        b.iter(|| {
            let task_tx = tx.clone();
            rt.block_on(async move {
                for _ in 0..1_000 {
                    let (o_tx, o_rx) = oneshot::channel();
                    task_tx.send(o_tx).await.unwrap();
                    let _ = o_rx.await;
                }
            })
        })
    });
}

criterion_group!(
    sync_mpsc_oneshot_group,
    request_reply_current_thread,
    request_reply_multi_threaded,
);

criterion_main!(sync_mpsc_oneshot_group);


================================================
FILE: benches/sync_notify.rs
================================================
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;

use tokio::sync::Notify;

use criterion::measurement::WallTime;
use criterion::{criterion_group, criterion_main, BenchmarkGroup, Criterion};

fn rt() -> tokio::runtime::Runtime {
    tokio::runtime::Builder::new_multi_thread()
        .worker_threads(6)
        .build()
        .unwrap()
}

fn notify_waiters<const N_WAITERS: usize>(g: &mut BenchmarkGroup<WallTime>) {
    let rt = rt();
    let notify = Arc::new(Notify::new());
    let counter = Arc::new(AtomicUsize::new(0));
    for _ in 0..N_WAITERS {
        rt.spawn({
            let notify = notify.clone();
            let counter = counter.clone();
            async move {
                loop {
                    notify.notified().await;
                    counter.fetch_add(1, Ordering::Relaxed);
                }
            }
        });
    }

    const N_ITERS: usize = 500;
    g.bench_function(N_WAITERS.to_string(), |b| {
        b.iter(|| {
            counter.store(0, Ordering::Relaxed);
            loop {
                notify.notify_waiters();
                if counter.load(Ordering::Relaxed) >= N_ITERS {
                    break;
                }
            }
        })
    });
}

fn notify_one<const N_WAITERS: usize>(g: &mut BenchmarkGroup<WallTime>) {
    let rt = rt();
    let notify = Arc::new(Notify::new());
    let counter = Arc::new(AtomicUsize::new(0));
    for _ in 0..N_WAITERS {
        rt.spawn({
            let notify = notify.clone();
            let counter = counter.clone();
            async move {
                loop {
                    notify.notified().await;
                    counter.fetch_add(1, Ordering::Relaxed);
                }
            }
        });
    }

    const N_ITERS: usize = 500;
    g.bench_function(N_WAITERS.to_string(), |b| {
        b.iter(|| {
            counter.store(0, Ordering::Relaxed);
            loop {
                notify.notify_one();
                if counter.load(Ordering::Relaxed) >= N_ITERS {
                    break;
                }
            }
        })
    });
}

fn bench_notify_one(c: &mut Criterion) {
    let mut group = c.benchmark_group("notify_one");
    notify_one::<10>(&mut group);
    notify_one::<50>(&mut group);
    notify_one::<100>(&mut group);
    notify_one::<200>(&mut group);
    notify_one::<500>(&mut group);
    group.finish();
}

fn bench_notify_waiters(c: &mut Criterion) {
    let mut group = c.benchmark_group("notify_waiters");
    notify_waiters::<10>(&mut group);
    notify_waiters::<50>(&mut group);
    notify_waiters::<100>(&mut group);
    notify_waiters::<200>(&mut group);
    notify_waiters::<500>(&mut group);
    group.finish();
}

criterion_group!(
    notify_waiters_simple,
    bench_notify_one,
    bench_notify_waiters
);

criterion_main!(notify_waiters_simple);


================================================
FILE: benches/sync_rwlock.rs
================================================
use std::sync::Arc;
use tokio::{sync::RwLock, task};

use criterion::measurement::WallTime;
use criterion::{black_box, criterion_group, criterion_main, BenchmarkGroup, Criterion};

fn read_uncontended(g: &mut BenchmarkGroup<WallTime>) {
    let rt = tokio::runtime::Builder::new_multi_thread()
        .worker_threads(6)
        .build()
        .unwrap();

    let lock = Arc::new(RwLock::new(()));
    g.bench_function("read", |b| {
        b.iter(|| {
            let lock = lock.clone();
            rt.block_on(async move {
                for _ in 0..6 {
                    let read = lock.read().await;
                    let _read = black_box(read);
                }
            })
        })
    });
}

fn read_concurrent_uncontended_multi(g: &mut BenchmarkGroup<WallTime>) {
    let rt = tokio::runtime::Builder::new_multi_thread()
        .worker_threads(6)
        .build()
        .unwrap();

    async fn task(lock: Arc<RwLock<()>>) {
        let read = lock.read().await;
        let _read = black_box(read);
    }

    let lock = Arc::new(RwLock::new(()));
    g.bench_function("read_concurrent_multi", |b| {
        b.iter(|| {
            let lock = lock.clone();
            rt.block_on(async move {
                let j = tokio::try_join! {
                    task::spawn(task(lock.clone())),
                    task::spawn(task(lock.clone())),
                    task::spawn(task(lock.clone())),
                    task::spawn(task(lock.clone())),
                    task::spawn(task(lock.clone())),
                    task::spawn(task(lock.clone()))
                };
                j.unwrap();
            })
        })
    });
}

fn read_concurrent_uncontended(g: &mut BenchmarkGroup<WallTime>) {
    let rt = tokio::runtime::Builder::new_current_thread()
        .build()
        .unwrap();

    async fn task(lock: Arc<RwLock<()>>) {
        let read = lock.read().await;
        let _read = black_box(read);
    }

    let lock = Arc::new(RwLock::new(()));
    g.bench_function("read_concurrent", |b| {
        b.iter(|| {
            let lock = lock.clone();
            rt.block_on(async move {
                tokio::join! {
                    task(lock.clone()),
                    task(lock.clone()),
                    task(lock.clone()),
                    task(lock.clone()),
                    task(lock.clone()),
                    task(lock.clone())
                };
            })
        })
    });
}

fn read_concurrent_contended_multi(g: &mut BenchmarkGroup<WallTime>) {
    let rt = tokio::runtime::Builder::new_multi_thread()
        .worker_threads(6)
        .build()
        .unwrap();

    async fn task(lock: Arc<RwLock<()>>) {
        let read = lock.read().await;
        let _read = black_box(read);
    }

    let lock = Arc::new(RwLock::new(()));
    g.bench_function("read_concurrent_multi", |b| {
        b.iter(|| {
            let lock = lock.clone();
            rt.block_on(async move {
                let write = lock.write().await;
                let j = tokio::try_join! {
                    async move { drop(write); Ok(()) },
                    task::spawn(task(lock.clone())),
                    task::spawn(task(lock.clone())),
                    task::spawn(task(lock.clone())),
                    task::spawn(task(lock.clone())),
                    task::spawn(task(lock.clone())),
                };
                j.unwrap();
            })
        })
    });
}

fn read_concurrent_contended(g: &mut BenchmarkGroup<WallTime>) {
    let rt = tokio::runtime::Builder::new_current_thread()
        .build()
        .unwrap();

    async fn task(lock: Arc<RwLock<()>>) {
        let read = lock.read().await;
        let _read = black_box(read);
    }

    let lock = Arc::new(RwLock::new(()));
    g.bench_function("read_concurrent", |b| {
        b.iter(|| {
            let lock = lock.clone();
            rt.block_on(async move {
                let write = lock.write().await;
                tokio::join! {
                    async move { drop(write) },
                    task(lock.clone()),
                    task(lock.clone()),
                    task(lock.clone()),
                    task(lock.clone()),
                    task(lock.clone()),
                };
            })
        })
    });
}

fn bench_contention(c: &mut Criterion) {
    let mut group = c.benchmark_group("contention");
    read_concurrent_contended(&mut group);
    read_concurrent_contended_multi(&mut group);
    group.finish();
}

fn bench_uncontented(c: &mut Criterion) {
    let mut group = c.benchmark_group("uncontented");
    read_uncontended(&mut group);
    read_concurrent_uncontended(&mut group);
    read_concurrent_uncontended_multi(&mut group);
    group.finish();
}

criterion_group!(contention, bench_contention);
criterion_group!(uncontented, bench_uncontented);

criterion_main!(contention, uncontented);


================================================
FILE: benches/sync_semaphore.rs
================================================
use std::sync::Arc;
use tokio::runtime::Runtime;
use tokio::{sync::Semaphore, task};

use criterion::measurement::WallTime;
use criterion::{criterion_group, criterion_main, BenchmarkGroup, Criterion};

fn single_rt() -> Runtime {
    tokio::runtime::Builder::new_current_thread()
        .build()
        .unwrap()
}

fn multi_rt() -> Runtime {
    tokio::runtime::Builder::new_multi_thread()
        .worker_threads(6)
        .build()
        .unwrap()
}

fn uncontended(g: &mut BenchmarkGroup<WallTime>) {
    let rt = multi_rt();

    let s = Arc::new(Semaphore::new(10));
    g.bench_function("multi", |b| {
        b.iter(|| {
            let s = s.clone();
            rt.block_on(async move {
                for _ in 0..6 {
                    let permit = s.acquire().await;
                    drop(permit);
                }
            })
        })
    });
}

async fn task(s: Arc<Semaphore>) {
    let permit = s.acquire().await;
    drop(permit);
}

fn uncontended_concurrent_multi(g: &mut BenchmarkGroup<WallTime>) {
    let rt = multi_rt();

    let s = Arc::new(Semaphore::new(10));
    g.bench_function("concurrent_multi", |b| {
        b.iter(|| {
            let s = s.clone();
            rt.block_on(async move {
                let j = tokio::try_join! {
                    task::spawn(task(s.clone())),
                    task::spawn(task(s.clone())),
                    task::spawn(task(s.clone())),
                    task::spawn(task(s.clone())),
                    task::spawn(task(s.clone())),
                    task::spawn(task(s.clone()))
                };
                j.unwrap();
            })
        })
    });
}

fn uncontended_concurrent_single(g: &mut BenchmarkGroup<WallTime>) {
    let rt = single_rt();

    let s = Arc::new(Semaphore::new(10));
    g.bench_function("concurrent_single", |b| {
        b.iter(|| {
            let s = s.clone();
            rt.block_on(async move {
                tokio::join! {
                    task(s.clone()),
                    task(s.clone()),
                    task(s.clone()),
                    task(s.clone()),
                    task(s.clone()),
                    task(s.clone())
                };
            })
        })
    });
}

fn contended_concurrent_multi(g: &mut BenchmarkGroup<WallTime>) {
    let rt = multi_rt();

    let s = Arc::new(Semaphore::new(5));
    g.bench_function("concurrent_multi", |b| {
        b.iter(|| {
            let s = s.clone();
            rt.block_on(async move {
                let j = tokio::try_join! {
                    task::spawn(task(s.clone())),
                    task::spawn(task(s.clone())),
                    task::spawn(task(s.clone())),
                    task::spawn(task(s.clone())),
                    task::spawn(task(s.clone())),
                    task::spawn(task(s.clone()))
                };
                j.unwrap();
            })
        })
    });
}

fn contended_concurrent_single(g: &mut BenchmarkGroup<WallTime>) {
    let rt = single_rt();

    let s = Arc::new(Semaphore::new(5));
    g.bench_function("concurrent_single", |b| {
        b.iter(|| {
            let s = s.clone();
            rt.block_on(async move {
                tokio::join! {
                    task(s.clone()),
                    task(s.clone()),
                    task(s.clone()),
                    task(s.clone()),
                    task(s.clone()),
                    task(s.clone())
                };
            })
        })
    });
}

fn bench_contention(c: &mut Criterion) {
    let mut group = c.benchmark_group("contention");
    contended_concurrent_multi(&mut group);
    contended_concurrent_single(&mut group);
    group.finish();
}

fn bench_uncontented(c: &mut Criterion) {
    let mut group = c.benchmark_group("uncontented");
    uncontended(&mut group);
    uncontended_concurrent_multi(&mut group);
    uncontended_concurrent_single(&mut group);
    group.finish();
}

criterion_group!(contention, bench_contention);
criterion_group!(uncontented, bench_uncontented);

criterion_main!(contention, uncontented);


================================================
FILE: benches/sync_watch.rs
================================================
use rand::prelude::*;
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;
use tokio::sync::{watch, Notify};

use criterion::measurement::WallTime;
use criterion::{black_box, criterion_group, criterion_main, BenchmarkGroup, Criterion};

fn rt() -> tokio::runtime::Runtime {
    tokio::runtime::Builder::new_multi_thread()
        .worker_threads(6)
        .build()
        .unwrap()
}

fn do_work(rng: &mut impl RngCore) -> u32 {
    use std::fmt::Write;
    let mut message = String::new();
    for i in 1..=10 {
        let _ = write!(&mut message, " {i}={}", rng.random::<f64>());
    }
    message
        .as_bytes()
        .iter()
        .map(|&c| c as u32)
        .fold(0, u32::wrapping_add)
}

fn contention_resubscribe<const N_TASKS: usize>(g: &mut BenchmarkGroup<WallTime>) {
    let rt = rt();
    let (snd, _) = watch::channel(0i32);
    let snd = Arc::new(snd);
    let wg = Arc::new((AtomicU64::new(0), Notify::new()));
    for n in 0..N_TASKS {
        let mut rcv = snd.subscribe();
        let wg = wg.clone();
        let mut rng = rand::rngs::StdRng::seed_from_u64(n as u64);
        rt.spawn(async move {
            while rcv.changed().await.is_ok() {
                let _ = *rcv.borrow(); // contend on rwlock
                let r = do_work(&mut rng);
                let _ = black_box(r);
                if wg.0.fetch_sub(1, Ordering::Release) == 1 {
                    wg.1.notify_one();
                }
            }
        });
    }

    const N_ITERS: usize = 100;
    g.bench_function(N_TASKS.to_string(), |b| {
        b.iter(|| {
            rt.block_on({
                let snd = snd.clone();
                let wg = wg.clone();
                async move {
                    tokio::spawn(async move {
                        for _ in 0..N_ITERS {
                            assert_eq!(wg.0.fetch_add(N_TASKS as u64, Ordering::Relaxed), 0);
                            let _ = snd.send(black_box(42));
                            while wg.0.load(Ordering::Acquire) > 0 {
                                wg.1.notified().await;
                            }
                        }
                    })
                    .await
                    .unwrap();
                }
            });
        })
    });
}

fn bench_contention_resubscribe(c: &mut Criterion) {
    let mut group = c.benchmark_group("contention_resubscribe");
    contention_resubscribe::<10>(&mut group);
    contention_resubscribe::<100>(&mut group);
    contention_resubscribe::<500>(&mut group);
    contention_resubscribe::<1000>(&mut group);
    group.finish();
}

criterion_group!(contention, bench_contention_resubscribe);

criterion_main!(contention);


================================================
FILE: benches/time_now.rs
================================================
//! Benchmark spawning a task onto the basic and threaded Tokio executors.
//! This essentially measure the time to enqueue a task in the local and remote
//! case.

use criterion::{black_box, criterion_group, criterion_main, Criterion};

fn time_now_current_thread(c: &mut Criterion) {
    let rt = tokio::runtime::Builder::new_current_thread()
        .enable_time()
        .build()
        .unwrap();

    c.bench_function("time_now_current_thread", |b| {
        b.iter(|| {
            rt.block_on(async {
                black_box(tokio::time::Instant::now());
            })
        })
    });
}

criterion_group!(time_now, time_now_current_thread);

criterion_main!(time_now);


================================================
FILE: benches/time_timeout.rs
================================================
use std::time::{Duration, Instant};

use criterion::{black_box, criterion_group, criterion_main, Criterion};
use tokio::{
    runtime::Runtime,
    time::{sleep, timeout},
};

// a very quick async task, but might timeout
async fn quick_job() -> usize {
    1
}

fn build_run_time(workers: usize) -> Runtime {
    if workers == 1 {
        tokio::runtime::Builder::new_current_thread()
            .enable_all()
            .build()
            .unwrap()
    } else {
        tokio::runtime::Builder::new_multi_thread()
            .enable_all()
            .worker_threads(workers)
            .build()
            .unwrap()
    }
}

fn single_thread_scheduler_timeout(c: &mut Criterion) {
    do_timeout_test(c, 1, "single_thread_timeout");
}

fn multi_thread_scheduler_timeout(c: &mut Criterion) {
    do_timeout_test(c, 8, "multi_thread_timeout-8");
}

fn do_timeout_test(c: &mut Criterion, workers: usize, name: &str) {
    let runtime = build_run_time(workers);
    c.bench_function(name, |b| {
        b.iter_custom(|iters| {
            let start = Instant::now();
            runtime.block_on(async {
                black_box(spawn_timeout_job(iters as usize, workers)).await;
            });
            start.elapsed()
        })
    });
}

async fn spawn_timeout_job(iters: usize, procs: usize) {
    let mut handles = Vec::with_capacity(procs);
    for _ in 0..procs {
        handles.push(tokio::spawn(async move {
            for _ in 0..iters / procs {
                let h = timeout(Duration::from_secs(1), quick_job());
                assert_eq!(black_box(h.await.unwrap()), 1);
            }
        }));
    }
    for handle in handles {
        handle.await.unwrap();
    }
}

fn single_thread_scheduler_sleep(c: &mut Criterion) {
    do_sleep_test(c, 1, "single_thread_sleep");
}

fn multi_thread_scheduler_sleep(c: &mut Criterion) {
    do_sleep_test(c, 8, "multi_thread_sleep-8");
}

fn do_sleep_test(c: &mut Criterion, workers: usize, name: &str) {
    let runtime = build_run_time(workers);

    c.bench_function(name, |b| {
        b.iter_custom(|iters| {
            let start = Instant::now();
            runtime.block_on(async {
                black_box(spawn_sleep_job(iters as usize, workers)).await;
            });
            start.elapsed()
        })
    });
}

async fn spawn_sleep_job(iters: usize, procs: usize) {
    let mut handles = Vec::with_capacity(procs);
    for _ in 0..procs {
        handles.push(tokio::spawn(async move {
            for _ in 0..iters / procs {
                let _h = black_box(sleep(Duration::from_secs(1)));
            }
        }));
    }
    for handle in handles {
        handle.await.unwrap();
    }
}

criterion_group!(
    timeout_benchmark,
    single_thread_scheduler_timeout,
    multi_thread_scheduler_timeout,
    single_thread_scheduler_sleep,
    multi_thread_scheduler_sleep
);

criterion_main!(timeout_benchmark);


================================================
FILE: deny.toml
================================================
# https://embarkstudios.github.io/cargo-deny/cli/init.html

[graph]
all-features = true

[licenses]
allow = [
    "MIT",
    "Apache-2.0",
]
exceptions = [
    { allow = ["Unicode-3.0"], crate = "unicode-ident" },
]

[bans]
multiple-versions = "allow"
wildcards = "deny"

[sources]
unknown-registry = "deny"
unknown-git = "deny"


================================================
FILE: docs/contributing/README.md
================================================
# Contributing

This guide will help you get started. **Do not let this guide intimidate you**.
It should be considered a map to help you navigate the process.

## Quick start

If you are unsure where to begin, use the following guides:

- Want to report or triage a bug? Start with [Contributing in Issues](contributing-in-issues.md).
- Looking for something to work on? Filter issues by [`E-help-wanted`](https://github.com/tokio-rs/tokio/labels/E-help-wanted).
- Planning to submit a PR? Read [Pull Requests](pull-requests.md) for the full workflow and required checks.
- Want to understand what the labels on issues mean? See [Keeping track of issues and PRs](keeping-track-of-issues-and-prs.md).
- Interested in code review? See [Reviewing Pull Requests](reviewing-pull-requests.md).

## Table of Contents

- [Contributing in Issues](contributing-in-issues.md)
    - [Asking for General Help](contributing-in-issues.md#asking-for-general-help)
    - [Submitting a Bug Report](contributing-in-issues.md#submitting-a-bug-report)
    - [Triaging a Bug Report](contributing-in-issues.md#triaging-a-bug-report)
    - [Resolving a Bug Report](contributing-in-issues.md#resolving-a-bug-report)
- [Pull Requests](pull-requests.md)
    - [Cargo Commands](pull-requests.md#cargo-commands)
    - [Performing spellcheck on tokio codebase](pull-requests.md#performing-spellcheck-on-tokio-codebase)
    - [Tests](pull-requests.md#tests)
        - [Integration tests](pull-requests.md#integration-tests)
        - [Fuzz tests](pull-requests.md#fuzz-tests)
        - [Documentation tests](pull-requests.md#documentation-tests)
    - [Benchmarks](pull-requests.md#benchmarks)
    - [Commits](pull-requests.md#commits)
        - [Commit message guidelines](pull-requests.md#commit-message-guidelines)
    - [Opening the Pull Request](pull-requests.md#opening-the-pull-request)
    - [Discuss and update](pull-requests.md#discuss-and-update)
    - [Commit Squashing](pull-requests.md#commit-squashing)
- [Reviewing Pull Requests](reviewing-pull-requests.md)
    - [Review a bit at a time](reviewing-pull-requests.md#review-a-bit-at-a-time)
    - [Be aware of the person behind the code](reviewing-pull-requests.md#be-aware-of-the-person-behind-the-code)
    - [Abandoned or Stalled Pull Requests](reviewing-pull-requests.md#abandoned-or-stalled-pull-requests)
- [How to specify crates dependencies versions](how-to-specify-crates-dependencies-versions.md)
- [Keeping track of issues and PRs](keeping-track-of-issues-and-prs.md)
    - [Area](keeping-track-of-issues-and-prs.md#area)
    - [Category](keeping-track-of-issues-and-prs.md#category)
    - [Calls for participation](keeping-track-of-issues-and-prs.md#calls-for-participation)
    - [Module](keeping-track-of-issues-and-prs.md#module)
    - [Topic](keeping-track-of-issues-and-prs.md#topic)


================================================
FILE: docs/contributing/contributing-in-issues.md
================================================
## Contributing in Issues

For any issue, there are fundamentally three ways an individual can contribute:

1. By opening the issue for discussion: For instance, if you believe that you
   have discovered a bug in Tokio, creating a new issue in [the tokio-rs/tokio
   issue tracker][issue] is the way to report it.

2. By helping to triage the issue: This can be done by providing
   supporting details (a test case that demonstrates a bug), providing
   suggestions on how to address the issue, or ensuring that the issue is tagged
   correctly.

3. By helping to resolve the issue: Typically this is done either in the form of
   demonstrating that the issue reported is not a problem after all, or more
   often, by opening a Pull Request that changes some bit of something in
   Tokio in a concrete and reviewable manner.

[issue]: https://github.com/tokio-rs/tokio/issues

**Anybody can participate in any stage of contribution**. We urge you to
participate in the discussion around bugs and participate in reviewing PRs.

### Asking for General Help

If you have reviewed existing documentation and still have questions or are
having problems, you can [open a discussion] asking for help.

In exchange for receiving help, we ask that you contribute back a documentation
PR that helps others avoid the problems that you encountered.

[open a discussion]: https://github.com/tokio-rs/tokio/discussions/new/choose

### Submitting a Bug Report

When opening a new issue in the Tokio issue tracker, you will be presented
with a basic template that should be filled in. If you believe that you have
uncovered a bug, please fill out this form, following the template to the best
of your ability. Do not worry if you cannot answer every detail, just fill in
what you can.

The two most important pieces of information we need in order to properly
evaluate the report is a description of the behavior you are seeing and a simple
test case we can use to recreate the problem on our own. If we cannot recreate
the issue, it becomes impossible for us to fix.

In order to rule out the possibility of bugs introduced by userland code, test
cases should be limited, as much as possible, to using only Tokio APIs.

See [How to create a Minimal, Complete, and Verifiable example][mcve].

[mcve]: https://stackoverflow.com/help/mcve

### Triaging a Bug Report

Once an issue has been opened, it is not uncommon for there to be discussion
around it. Some contributors may have differing opinions about the issue,
including whether the behavior being seen is a bug or a feature. This discussion
is part of the process and should be kept focused, helpful, and professional.

Short, clipped responses—that provide neither additional context nor supporting
detail—are not helpful or professional. To many, such responses are simply
annoying and unfriendly.

Contributors are encouraged to help one another make forward progress as much as
possible, empowering one another to solve issues collaboratively. If you choose
to comment on an issue that you feel either is not a problem that needs to be
fixed, or if you encounter information in an issue that you feel is incorrect,
explain why you feel that way with additional supporting context, and be willing
to be convinced that you may be wrong. By doing so, we can often reach the
correct outcome much faster.

### Resolving a Bug Report

In the majority of cases, issues are resolved by opening a Pull Request. The
process for opening and reviewing a Pull Request is similar to that of opening
and triaging issues, but carries with it a necessary review and approval
workflow that ensures that the proposed changes meet the minimal quality and
functional guidelines of the Tokio project.


================================================
FILE: docs/contributing/how-to-specify-crates-dependencies-versions.md
================================================
# How to specify crates dependencies versions

Each crate (e.g., `tokio-util`, `tokio-stream`, etc.) should specify dependencies
according to these rules:

1. The listed version should be the oldest version that the crate works with
(e.g., if `tokio-util` works with `tokio` version `1.44` but not `1.43`, then
`tokio-util` should specify version `1.44` for its `tokio` dependency).
We don't require users to use the latest version unnecessarily.
2. When a crate starts using a newer feature in a dependency, the version
should be bumped to the version that introduced it.
3. If a crate depends on an unreleased feature in a dependency, it may use
`path = ` dependency to specify this. Since path dependencies must be removed
during the release of the crate, this ensures that it can't be released until
the dependency has a new version.

Consider the following example from `tokio-stream`:

```toml
[dependencies]
futures-core = { version = "0.3.0" }
pin-project-lite = "0.2.11"
tokio = { path = "../tokio", features = ["sync"] }
```

In this case, local development of `tokio-stream` uses the local version
of `tokio` via the `path` dependency. This means that it's currently not
possible to release `tokio-stream`. Once a new version of `tokio` is
released, the path dependency will be removed from `tokio-stream`.
As mentioned before, this version should only be bumped when adding a new
feature in the crate that relies on a newer version.


================================================
FILE: docs/contributing/keeping-track-of-issues-and-prs.md
================================================
## Keeping track of issues and PRs

The Tokio GitHub repository has a lot of issues and PRs to keep track of. This
section explains the meaning of various labels, as well as our [GitHub
project][project]. The section is primarily targeted at maintainers.  Most
contributors aren't able to set these labels.

### Area

The area label describes the crates relevant to this issue or PR.

- **A-ci** This issue concerns our GitHub Actions setup.
- **A-tokio** This issue concerns the main Tokio crate.
- **A-readme** This issue is related to documentation such as README.md.
- **A-benches** This issue concerns the benchmarks.
- **A-examples** This issue concerns the examples.
- **A-tokio-test** The issue concerns the `tokio-test` crate.
- **A-tokio-util** This issue concerns the `tokio-util` crate.
- **A-tokio-macros** This issue concerns the `tokio-macros` crate. Should only
  be used for the procedural macros, and not `join!` or `select!`.
- **A-tokio-stream** This issue concerns the `tokio-stream` crate.

### Category

- **C-bug** This is a bug-report. Bug-fix PRs use `C-enhancement` instead.
- **C-enhancement** This is a PR that adds a new features.
- **C-maintenance** This is an issue or PR about stuff such as documentation,
  GitHub Actions or code quality.
- **C-feature-request** This is a feature request. Implementations of feature
  requests use `C-enhancement` instead.
- **C-feature-accepted** If you submit a PR for this feature request, we won't
  close it with the reason "we don't want this". Issues with this label should
  also have the `C-feature-request` label.
- **C-musing** Stuff like tracking issues or roadmaps. "musings about a better
  world"
- **C-proposal** A proposal of some kind, and a request for comments.
- **C-question** A user question. Large overlap with GitHub discussions.
- **C-request** A non-feature request, e.g. "please add deprecation notices to
  `-alpha.*` versions of crates"

### Calls for participation

- **E-help-wanted** Stuff where we want help. Often seen together with `C-bug`
  or `C-feature-accepted`.
- **E-easy** This is easy, ranging from quick documentation fixes to stuff you
  can do after reading the tutorial on our website.
- **E-medium** This is not `E-easy` or `E-hard`.
- **E-hard** This either involves very tricky code, is something we don't know
  how to solve, or is challenging for some other reason.
- **E-needs-mvce** This bug is missing a minimal complete and verifiable
  example.

The "E-" prefix is the same as used in the Rust compiler repository. Some
issues are missing a difficulty rating, but feel free to ask on our Discord
server if you want to know how challenging an issue likely is.

### Module

The module label provides a more fine grained categorization than **Area**.

- **M-blocking** Things relevant to `spawn_blocking`, `block_in_place`.
- **M-codec** The `tokio_util::codec` module.
- **M-compat** The `tokio_util::compat` module.
- **M-coop** Things relevant to coop.
- **M-fs** The `tokio::fs` module.
- **M-io** The `tokio::io` module.
- **M-macros** Issues about any kind of macro.
- **M-metrics** Things relevant to `tokio::runtime::metrics`.
- **M-net** The `tokio::net` module.
- **M-process** The `tokio::process` module.
- **M-runtime** The `tokio::runtime` module.
- **M-signal** The `tokio::signal` module.
- **M-sync** The `tokio::sync` module.
- **M-task** The `tokio::task` module.
- **M-time** The `tokio::time` module.
- **M-tracing** Tracing support in Tokio.
- **M-taskdump** Things relevant to taskdump.

### Topic

Some extra information.

- **T-docs** This is about documentation.
- **T-performance** This is about performance.
- **T-v0.1.x** This is about old Tokio.

Any label not listed here is not in active use.

[project]: https://github.com/orgs/tokio-rs/projects/1


================================================
FILE: docs/contributing/pull-requests.md
================================================
## Pull Requests

Pull Requests are the way concrete changes are made to the code, documentation,
and dependencies in the Tokio repository.

Even tiny pull requests (e.g., one-character pull request fixing a typo in API
documentation) are greatly appreciated. Before making a large change, it is
usually a good idea to first open an issue describing the change to solicit
feedback and guidance. This will increase the likelihood of the PR getting
merged.

### Cargo Commands

Due to the extensive use of features in Tokio, you will often need to add extra
arguments to many common cargo commands. This section lists some commonly needed
commands.

Some commands just need the `--all-features` argument:

```
cargo build --all-features
cargo check --all-features
cargo test --all-features
```

**NOTE**: there are some features that are not supported in every system, so you might
need to specify which features you want to pass to cargo (e.g., `cargo check --features=full,io-uring`)

Ideally, you should use the same version of clippy as the one used in CI
(defined by `env.rust_clippy` in [ci.yml][ci.yml]), because newer versions
might have new lints:

[ci.yml]: ../../.github/workflows/ci.yml

<!--
When updating this, also update:
- .github/workflows/ci.yml
- README.md
- tokio/README.md
- tokio/Cargo.toml
- tokio-util/Cargo.toml
- tokio-test/Cargo.toml
- tokio-stream/Cargo.toml
-->

```
cargo +1.88 clippy --all --tests --all-features
```

When building documentation, a simple `cargo doc` is not sufficient. To produce
documentation equivalent to what will be produced in docs.rs's builds of Tokio's
docs, please use:

```
RUSTDOCFLAGS="--cfg docsrs --cfg tokio_unstable" RUSTFLAGS="--cfg docsrs --cfg tokio_unstable" cargo +nightly doc --all-features [--open]
```

This turns on indicators to display the Cargo features required for
conditionally compiled APIs in Tokio, and it enables documentation of unstable
Tokio features. Notice that it is necessary to pass cfg flags to both RustDoc
*and* rustc.

There is a more concise way to build docs.rs-equivalent docs by using [`cargo
docs-rs`], which reads the above documentation flags out of Tokio's Cargo.toml
as docs.rs itself does.

[`cargo docs-rs`]: https://github.com/dtolnay/cargo-docs-rs

```
cargo install --locked cargo-docs-rs
cargo +nightly docs-rs [--open]
```

The `cargo fmt` command does not work on the Tokio codebase. You can use the
command below instead:

```
# Mac or Linux
rustfmt --check --edition 2021 $(git ls-files '*.rs')

# Powershell
Get-ChildItem . -Filter "*.rs" -Recurse | foreach { rustfmt --check --edition 2021 $_.FullName }
```
The `--check` argument prints the things that need to be fixed. If you remove
it, `rustfmt` will update your files locally instead.

You can run loom tests with
```
cd tokio # tokio crate in workspace
LOOM_MAX_PREEMPTIONS=1 LOOM_MAX_BRANCHES=10000 RUSTFLAGS="--cfg loom -C debug_assertions" \
    cargo test --lib --release --features full -- --test-threads=1 --nocapture
```
Additionally, you can also add `--cfg tokio_unstable` to the `RUSTFLAGS` environment variable to
run loom tests that test unstable features.

You can run miri tests with
```
MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-strict-provenance" \
    cargo +nightly miri test --features full --lib --tests
```

### Performing spellcheck on tokio codebase

You can perform a spell-check on the Tokio codebase. For details of how to use the spellcheck tool, feel free to visit
https://github.com/drahnr/cargo-spellcheck
```
# First install the spell-check plugin
cargo install --locked cargo-spellcheck

# Then run the cargo spell check command
cargo spellcheck check
```

If the command rejects a word, you should backtick the rejected word if it's code related. If not, the
rejected word should be put into `spellcheck.dic` file.

Note that when you add a word into the file, you should also update the first line which tells the spellcheck tool
the total number of words included in the file

### Tests

If the change being proposed alters code (as opposed to only documentation for
example), it is either adding new functionality to Tokio or it is fixing
existing, broken functionality. In both of these cases, the pull request should
include one or more tests to ensure that Tokio does not regress in the future.
There are two ways to write tests: [integration tests][integration-tests]
and [documentation tests][documentation-tests].
(Tokio avoids [unit tests][unit-tests] as much as possible).

Tokio uses [conditional compilation attributes][conditional-compilation]
throughout the codebase, to modify rustc's behavior. Code marked with such
attributes can be enabled using `RUSTFLAGS` and `RUSTDOCFLAGS` environment
variables. One of the most prevalent flags passed in these variables is
the `--cfg` option. To run tests in a particular file, check first what
options #![cfg] declaration defines for that file.

For instance, to run a test marked with the 'tokio_unstable' cfg option,
you must pass this flag to the compiler when running the test.
```
$ RUSTFLAGS="--cfg tokio_unstable" cargo test -p tokio --all-features --test rt_metrics
```

#### Integration tests

Integration tests go in the same crate as the code they are testing. Each sub
crate should have a `dev-dependency` on `tokio` itself. This makes all Tokio
utilities available to use in tests, no matter the crate being tested.

The best strategy for writing a new integration test is to look at existing
integration tests in the crate and follow the style.

#### Fuzz tests

Some of our crates include a set of fuzz tests, this will be marked by a
directory `fuzz`. It is a good idea to run fuzz tests after each change.
To get started with fuzz testing you'll need to install
[cargo-fuzz](https://github.com/rust-fuzz/cargo-fuzz).

`cargo install --locked cargo-fuzz`

To list the available fuzzing harnesses you can run;

```bash
$ cd tokio
$ cargo fuzz list
fuzz_linked_list
```

Running a fuzz test is as simple as;

`cargo fuzz run fuzz_linked_list`

**NOTE**: Keep in mind that by default when running a fuzz test the fuzz
harness will run forever and will only exit if you `ctrl-c` or it finds
a bug.

#### Documentation tests

Ideally, every API has at least one [documentation test] that demonstrates how to
use the API. Documentation tests are run with `cargo test --doc`. This ensures
that the example is correct and provides additional test coverage.

The trick to documentation tests is striking a balance between being succinct
for a reader to understand and actually testing the API.

Same as with integration tests, when writing a documentation test, the full
`tokio` crate is available. This is especially useful for getting access to the
runtime to run the example.

The documentation tests will be visible from both the crate-specific
documentation **and** the `tokio` facade documentation via the re-export. The
example should be written from the point of view of a user that is using the
`tokio` crate. As such, the example should use the API via the facade and not by
directly referencing the crate.

The type level example for `tokio::time::timeout` provides a good example of a
documentation test:

```
/// Create a new `Timeout` set to expire in 10 milliseconds.
///
/// ```rust
/// use tokio::time::timeout;
/// use tokio::sync::oneshot;
///
/// use std::time::Duration;
///
/// # async fn dox() {
/// let (tx, rx) = oneshot::channel();
/// # tx.send(()).unwrap();
///
/// // Wrap the future with a `Timeout` set to expire in 10 milliseconds.
/// if let Err(_) = timeout(Duration::from_millis(10), rx).await {
///     println!("did not receive value within 10 ms");
/// }
/// # }
/// ```
```

Lines that start with `/// #` are removed when the documentation is generated.

### Benchmarks

You can run benchmarks locally for the changes you've made to the tokio codebase.
Tokio currently uses [Criterion](https://github.com/bheisler/criterion.rs) as its benchmarking tool. To run a benchmark
against the changes you have made, for example, you can run;

```bash
cd benches

# Run all benchmarks.
cargo bench

# Run all tests in the `benches/fs.rs` file
cargo bench --bench fs

# Run the `async_read_buf` benchmark in `benches/fs.rs` specifically.
cargo bench async_read_buf

# After running benches, you can check the statistics under `tokio/target/criterion/`
```

You can also refer to [Criterion] docs for additional options and details.

[Criterion]: https://docs.rs/criterion/latest/criterion/

### Commits

It is a recommended best practice to keep your changes as logically grouped as
possible within individual commits. There is no limit to the number of commits
any single Pull Request may have, and many contributors find it easier to review
changes that are split across multiple commits.

That said, if you have a number of commits that are "checkpoints" and don't
represent a single logical change, please squash those together.

Note that multiple commits often get squashed when they are landed (see the
notes about [commit squashing](#commit-squashing)).

#### Commit message guidelines

A good commit message should describe what changed and why.

1. The first line should:

* contain a short description of the change (preferably 50 characters or less,
  and no more than 72 characters)
* be entirely in lowercase with the exception of proper nouns, acronyms, and
  the words that refer to code, like function/variable names
* start with an imperative verb
* not have a period at the end
* be prefixed with the name of the module being changed; usually this is the
  same as the M-* label on the PR

Examples:

* time: introduce `Timeout` and deprecate `Deadline`
* codec: export `Encoder`, `Decoder`, `Framed*`
* ci: fix the FreeBSD ci configuration

2. Keep the second line blank.
3. Wrap all other lines at 72 columns (except for long URLs).
4. If your patch fixes an open issue, you can add a reference to it at the end
   of the log. Use the `Fixes: #` prefix and the issue number. For other
   references use `Refs: #`. `Refs` may include multiple issues, separated by a
   comma.

   Examples:

    - `Fixes: #1337`
    - `Refs: #1234`

Sample complete commit message:

```txt
module: explain the commit in one line

Body of commit message is a few lines of text, explaining things
in more detail, possibly giving some background about the issue
being fixed, etc.

The body of the commit message can be several paragraphs, and
please do proper word-wrap and keep columns shorter than about
72 characters or so. That way, `git log` will show things
nicely even when it is indented.

Fixes: #1337
Refs: #453, #154
```

### Opening the Pull Request

From within GitHub, opening a new Pull Request will present you with a
[template] that should be filled out. Please try to do your best at filling out
the details, but feel free to skip parts if you're not sure what to put.

[template]: ../../.github/PULL_REQUEST_TEMPLATE.md

### Discuss and update

You will probably get feedback or requests for changes to your Pull Request.
This is a big part of the submission process so don't be discouraged! Some
contributors may sign off on the Pull Request right away, others may have
more detailed comments or feedback. This is a necessary part of the process
in order to evaluate whether the changes are correct and necessary.

**Any community member can review a PR and you might get conflicting feedback**.
Keep an eye out for comments from code owners to provide guidance on conflicting
feedback.

**Once the PR is open, do not rebase the commits**. See [Commit Squashing](#commit-squashing) for
more details.

### Commit Squashing

In most cases, **do not squash commits that you add to your Pull Request during
the review process**. When the commits in your Pull Request land, they may be
squashed into one commit per logical change. Metadata will be added to the
commit message (including links to the Pull Request, links to relevant issues,
and the names of the reviewers). The commit history of your Pull Request,
however, will stay intact on the Pull Request page.

[integration-tests]: https://doc.rust-lang.org/rust-by-example/testing/integration_testing.html
[unit-tests]: https://doc.rust-lang.org/rust-by-example/testing/unit_testing.html
[documentation-tests]: https://doc.rust-lang.org/rust-by-example/testing/doc_testing.html
[conditional-compilation]: https://doc.rust-lang.org/reference/conditional-compilation.html


================================================
FILE: docs/contributing/reviewing-pull-requests.md
================================================
## Reviewing Pull Requests

**Any Tokio community member is welcome to review any pull request**.

All Tokio contributors who choose to review and provide feedback on Pull
Requests have a responsibility to both the project and the individual making the
contribution. Reviews and feedback must be helpful, insightful, and geared
towards improving the contribution as opposed to simply blocking it. If there
are reasons why you feel the PR should not land, explain what those are. Do not
expect to be able to block a Pull Request from advancing simply because you say
"No" without giving an explanation. Be open to having your mind changed. Be open
to working with the contributor to make the Pull Request better.

Reviews that are dismissive or disrespectful of the contributor or any other
reviewers are strictly counter to the Code of Conduct.

When reviewing a Pull Request, the primary goals are for the codebase to improve
and for the person submitting the request to succeed. **Even if a Pull Request
does not land, the submitters should come away from the experience feeling like
their effort was not wasted or unappreciated**. Every Pull Request from a new
contributor is an opportunity to grow the community.

### Review a bit at a time

Do not overwhelm new contributors.

It is tempting to micro-optimize and make everything about relative performance,
perfect grammar, or exact style matches. Do not succumb to that temptation.

Focus first on the most significant aspects of the change:

1. Does this change make sense for Tokio?
2. Does this change make Tokio better, even if only incrementally?
3. Are there clear bugs or larger scale issues that need attending to?
4. Is the commit message readable and correct? If it contains a breaking change
   is it clear enough?

Note that only **incremental** improvement is needed to land a PR. This means
that the PR does not need to be perfect, only better than the status quo. Follow
up PRs may be opened to continue iterating.

When changes are necessary, *request* them, do not *demand* them, and **do not
assume that the submitter already knows how to add a test or run a benchmark**.

Specific performance optimization techniques, coding styles and conventions
change over time. The first impression you give to a new contributor never does.

Nits (requests for small changes that are not essential) are fine, but try to
avoid stalling the Pull Request. Most nits can typically be fixed by the Tokio
Collaborator landing the Pull Request but they can also be an opportunity for
the contributor to learn a bit more about the project.

It is always good to clearly indicate nits when you comment: e.g.
`Nit: change foo() to bar(). But this is not blocking.`

If your comments were addressed but were not folded automatically after new
commits or if they proved to be mistaken, please, [hide them][hiding-a-comment]
with the appropriate reason to keep the conversation flow concise and relevant.

### Be aware of the person behind the code

Be aware that *how* you communicate requests and reviews in your feedback can
have a significant impact on the success of the Pull Request. Yes, we may land
a particular change that makes Tokio better, but the individual might just not
want to have anything to do with Tokio ever again. The goal is not just having
good code.

### Abandoned or Stalled Pull Requests

If a Pull Request appears to be abandoned or stalled, it is polite to first
check with the contributor to see if they intend to continue the work before
checking if they would mind if you took it over (especially if it just has nits
left). When doing so, it is courteous to give the original contributor credit
for the work they started (either by preserving their name and email address in
the commit log, or by using an `Author: ` meta-data tag in the commit.

_Adapted from the [Node.js contributing guide][node]_.

[node]: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md
[hiding-a-comment]: https://help.github.com/articles/managing-disruptive-comments/#hiding-a-comment


================================================
FILE: examples/Cargo.toml
================================================
[package]
name = "examples"
version = "0.0.0"
publish = false
edition = "2021"
license = "MIT"

# If you copy one of the examples into a new project, you should be using
# [dependencies] instead, and delete the **path**.
[dev-dependencies]
tokio = { version = "1.0.0", path = "../tokio", features = ["full", "tracing"] }
tokio-util = { version = "0.7.0", path = "../tokio-util", features = ["full"] }
tokio-stream = { version = "0.1", path = "../tokio-stream" }

tracing = "0.1"
tracing-subscriber = { version = "0.3.1", default-features = false, features = ["fmt", "ansi", "env-filter", "tracing-log"] }
bytes = "1.0.0"
futures = { version = "0.3.0", features = ["thread-pool"]}
http = "1"
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"
httparse = "1.0"
httpdate = "1.0"
once_cell = "1.5.2"

[target.'cfg(all(tokio_unstable, target_os = "linux"))'.dev-dependencies]
tokio = { version = "1.0.0", path = "../tokio", features = ["full", "tracing", "taskdump"] }

[target.'cfg(windows)'.dev-dependencies.windows-sys]
version = "0.61"

[[example]]
name = "chat"
path = "chat.rs"

[[example]]
name = "connect-tcp"
path = "connect-tcp.rs"

[[example]]
name = "connect-udp"
path = "connect-udp.rs"

[[example]]
name = "echo-tcp"
path = "echo-tcp.rs"

[[example]]
name = "echo-udp"
path = "echo-udp.rs"

[[example]]
name = "hello_world"
path = "hello_world.rs"

[[example]]
name = "print_each_packet"
path = "print_each_packet.rs"

[[example]]
name = "proxy"
path = "proxy.rs"

[[example]]
name = "tinydb"
path = "tinydb.rs"

[[example]]
name = "udp-client"
path = "udp-client.rs"

[[example]]
name = "udp-codec"
path = "udp-codec.rs"

[[example]]
name = "tinyhttp"
path = "tinyhttp.rs"

[[example]]
name = "custom-executor"
path = "custom-executor.rs"

[[example]]
name = "custom-executor-tokio-context"
path = "custom-executor-tokio-context.rs"

[[example]]
name = "named-pipe"
path = "named-pipe.rs"

[[example]]
name = "named-pipe-ready"
path = "named-pipe-ready.rs"

[[example]]
name = "named-pipe-multi-client"
path = "named-pipe-multi-client.rs"

[[example]]
name = "dump"
path = "dump.rs"

[lints]
workspace = true


================================================
FILE: examples/README.md
================================================
## Examples of how to use Tokio

This directory contains a number of examples showcasing various capabilities of
the `tokio` crate.

All examples can be executed with:

```
cargo run --example $name
```

A good starting point for the examples would be [`hello_world`](hello_world.rs)
and [`echo-tcp`](echo-tcp.rs). Additionally [the tokio website][tokioweb] contains
additional guides for some of the examples.

For a larger "real world" example, see the [`mini-redis`][redis] repository.

If you've got an example you'd like to see here, please feel free to open an
issue. Otherwise if you've got an example you'd like to add, please feel free
to make a PR!

[tokioweb]: https://tokio.rs/tokio/tutorial
[redis]: https://github.com/tokio-rs/mini-redis


================================================
FILE: examples/chat.rs
================================================
//! A chat server that broadcasts a message to all connections.
//!
//! This example is explicitly more verbose than it has to be. This is to
//! illustrate more concepts.
//!
//! A chat server for telnet clients. After a telnet client connects, the first
//! line should contain the client's name. After that, all lines sent by a
//! client are broadcasted to all other connected clients.
//!
//! Because the client is telnet, lines are delimited by "\r\n".
//!
//! You can test this out by running:
//!
//!     cargo run --example chat
//!
//! And then in another terminal run:
//!
//!     telnet localhost 6142
//!
//! You can run the `telnet` command in any number of additional windows.
//!
//! You can run the second command in multiple windows and then chat between the
//! two, seeing the messages from the other client as they're received. For all
//! connected clients they'll all join the same room and see everyone else's
//! messages.

#![warn(rust_2018_idioms)]

use tokio::net::{TcpListener, TcpStream};
use tokio::sync::{mpsc, Mutex};
use tokio_stream::StreamExt;
use tokio_util::codec::{Framed, LinesCodec};

use futures::SinkExt;
use std::collections::HashMap;
use std::env;
use std::error::Error;
use std::io;
use std::net::SocketAddr;
use std::sync::Arc;

const DEFAULT_ADDR: &str = "127.0.0.1:6142";

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    use tracing_subscriber::{fmt::format::FmtSpan, EnvFilter};
    // Configure a `tracing` subscriber that logs traces emitted by the chat
    // server.
    tracing_subscriber::fmt()
        // Filter what traces are displayed based on the RUST_LOG environment
        // variable.
        //
        // Traces emitted by the example code will always be displayed. You
        // can set `RUST_LOG=tokio=trace` to enable additional traces emitted by
        // Tokio itself.
        .with_env_filter(EnvFilter::from_default_env().add_directive("chat=info".parse()?))
        // Log events when `tracing` spans are created, entered, exited, or
        // closed. When Tokio's internal tracing support is enabled (as
        // described above), this can be used to track the lifecycle of spawned
        // tasks on the Tokio runtime.
        .with_span_events(FmtSpan::FULL)
        // Set this subscriber as the default, to collect all traces emitted by
        // the program.
        .init();

    // Create the shared state. This is how all the peers communicate.
    //
    // The server task will hold a handle to this. For every new client, the
    // `state` handle is cloned and passed into the task that processes the
    // client connection.
    let state = Arc::new(Mutex::new(Shared::new()));

    let addr = env::args()
        .nth(1)
        .unwrap_or_else(|| DEFAULT_ADDR.to_string());

    // Bind a TCP listener to the socket address.
    //
    // Note that this is the Tokio TcpListener, which is fully async.
    let listener = TcpListener::bind(&addr).await?;

    tracing::info!("server running on {addr}");

    loop {
        // Asynchronously wait for an inbound TcpStream.
        let (stream, addr) = listener.accept().await?;

        // Clone a handle to the `Shared` state for the new connection.
        let state = Arc::clone(&state);

        // Spawn our handler to be run asynchronously.
        tokio::spawn(async move {
            tracing::debug!("accepted connection from {addr}");
            if let Err(e) = process(state, stream, addr).await {
                tracing::warn!("Connection from {addr} failed: {e:?}");
            }
        });
    }
}

/// Shorthand for the transmit half of the message channel.
type Tx = mpsc::UnboundedSender<String>;

/// Shorthand for the receive half of the message channel.
type Rx = mpsc::UnboundedReceiver<String>;

/// Data that is shared between all peers in the chat server.
///
/// This is the set of `Tx` handles for all connected clients. Whenever a
/// message is received from a client, it is broadcasted to all peers by
/// iterating over the `peers` entries and sending a copy of the message on each
/// `Tx`.
struct Shared {
    peers: HashMap<SocketAddr, Tx>,
}

/// The state for each connected client.
struct Peer {
    /// The TCP socket wrapped with the `Lines` codec, defined below.
    ///
    /// This handles sending and receiving data on the socket. When using
    /// `Lines`, we can work at the line level instead of having to manage the
    /// raw byte operations.
    lines: Framed<TcpStream, LinesCodec>,

    /// Receive half of the message channel.
    ///
    /// This is used to receive messages from peers. When a message is received
    /// off of this `Rx`, it will be written to the socket.
    rx: Rx,
}

impl Shared {
    /// Create a new, empty, instance of `Shared`.
    fn new() -> Self {
        Shared {
            peers: HashMap::new(),
        }
    }

    /// Send a `LineCodec` encoded message to every peer, except
    /// for the sender.
    ///
    /// This function also cleans up disconnected peers automatically.
    async fn broadcast(&mut self, sender: SocketAddr, message: &str) {
        let mut failed_peers = Vec::new();
        let message = message.to_string(); // Clone once for all sends

        for (addr, tx) in self.peers.iter() {
            if *addr != sender && tx.send(message.clone()).is_err() {
                // Receiver has been dropped, mark for removal
                failed_peers.push(*addr);
            }
        }

        // Clean up disconnected peers
        for addr in failed_peers {
            self.peers.remove(&addr);
            tracing::debug!("Removed disconnected peer: {addr}");
        }
    }
}

impl Peer {
    /// Create a new instance of `Peer`.
    async fn new(
        state: Arc<Mutex<Shared>>,
        lines: Framed<TcpStream, LinesCodec>,
    ) -> io::Result<Peer> {
        // Get the client socket address
        let addr = lines.get_ref().peer_addr()?;

        // Create a channel for this peer
        let (tx, rx) = mpsc::unbounded_channel();

        // Add an entry for this `Peer` in the shared state map.
        state.lock().await.peers.insert(addr, tx);

        Ok(Peer { lines, rx })
    }
}

/// Process an individual chat client
async fn process(
    state: Arc<Mutex<Shared>>,
    stream: TcpStream,
    addr: SocketAddr,
) -> Result<(), Box<dyn Error>> {
    let mut lines = Framed::new(stream, LinesCodec::new());

    // Send a prompt to the client to enter their username.
    lines.send("Please enter your username:").await?;

    // Read the first line from the `LineCodec` stream to get the username.
    let Some(Ok(username)) = lines.next().await else {
        // We didn't get a line so we return early here.
        tracing::error!("Failed to get username from {addr}. Client disconnected.");
        return Ok(());
    };

    // Register our peer with state which internally sets up some channels.
    let mut peer = Peer::new(state.clone(), lines).await?;

    // A client has connected, let's let everyone know.
    {
        let mut state = state.lock().await;
        let msg = format!("{username} has joined the chat");
        tracing::info!("{msg}");
        state.broadcast(addr, &msg).await;
    }

    // Process incoming messages until our stream is exhausted by a disconnect.
    loop {
        tokio::select! {
            // A message was received from a peer. Send it to the current user.
            Some(msg) = peer.rx.recv() => {
                if let Err(e) = peer.lines.send(&msg).await {
                    tracing::error!("Failed to send message to {username}: {e:?}");
                    break;
                }
            }
            result = peer.lines.next() => match result {
                // A message was received from the current user, we should
                // broadcast this message to the other users.
                Some(Ok(msg)) => {
                    let mut state = state.lock().await;
                    let msg = format!("{username}: {msg}");

                    state.broadcast(addr, &msg).await;
                }
                // An error occurred.
                Some(Err(e)) => {
                    tracing::error!(
                        "an error occurred while processing messages for {username}; error = {e:?}"
                    );
                    break;
                }
                // The stream has been exhausted.
                None => break,
            },
        }
    }

    // If this section is reached it means that the client was disconnected!
    // Let's let everyone still connected know about it.
    {
        let mut state = state.lock().await;
        state.peers.remove(&addr);

        let msg = format!("{username} has left the chat");
        tracing::info!("{msg}");
        state.broadcast(addr, &msg).await;
    }

    Ok(())
}


================================================
FILE: examples/connect-tcp.rs
================================================
//! An example of hooking up stdin/stdout to a TCP stream.
//!
//! This example will connect to a socket address specified in the argument list
//! and then forward all data read on stdin to the server, printing out all data
//! received on stdout. Each line entered on stdin will be translated to a TCP
//! packet which is then sent to the remote address.
//!
//! Note that this is not currently optimized for performance, especially
//! around buffer management. Rather it's intended to show an example of
//! working with a client.
//!
//! This example can be quite useful when interacting with the other examples in
//! this repository! Many of them recommend running this as a simple "hook up
//! stdin/stdout to a server" to get up and running.

#![warn(rust_2018_idioms)]

use tokio::io::{stdin, stdout};
use tokio::net::TcpStream;
use tokio_util::codec::{BytesCodec, FramedRead, FramedWrite};

use bytes::Bytes;
use futures::{future, Sink, SinkExt, Stream, StreamExt};
use std::env;
use std::error::Error;
use std::net::SocketAddr;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    // Parse what address we're going to connect to
    let args = env::args().skip(1).collect::<Vec<_>>();
    let addr = args
        .first()
        .ok_or("this program requires at least one argument")?;
    let addr = addr.parse::<SocketAddr>()?;

    let stdin = FramedRead::new(stdin(), BytesCodec::new());
    let stdin = stdin.map(|i| i.map(|bytes| bytes.freeze()));
    let stdout = FramedWrite::new(stdout(), BytesCodec::new());

    connect(&addr, stdin, stdout).await?;

    Ok(())
}

pub async fn connect(
    addr: &SocketAddr,
    mut stdin: impl Stream<Item = Result<Bytes, std::io::Error>> + Unpin,
    mut stdout: impl Sink<Bytes, Error = std::io::Error> + Unpin,
) -> Result<(), Box<dyn Error>> {
    let mut stream = TcpStream::connect(addr).await?;
    let (r, w) = stream.split();
    let mut sink = FramedWrite::new(w, BytesCodec::new());
    // filter map Result<BytesMut, Error> stream into just a Bytes stream to match stdout Sink
    // on the event of an Error, log the error and end the stream
    let mut stream = FramedRead::new(r, BytesCodec::new())
        .filter_map(|i| match i {
            //BytesMut into Bytes
            Ok(i) => future::ready(Some(i.freeze())),
            Err(e) => {
                eprintln!("failed to read from socket; error={e}");
                future::ready(None)
            }
        })
        .map(Ok);

    tokio::select! {
        r = sink.send_all(&mut stdin) => r?,
        r = stdout.send_all(&mut stream) => r?,
    }

    Ok(())
}


================================================
FILE: examples/connect-udp.rs
================================================
//! An example of hooking up stdin/stdout to a UDP stream.
//!
//! This example will connect to a socket address specified in the argument list
//! and then forward all data read on stdin to the server, printing out all data
//! received on stdout. Each line entered on stdin will be translated to a UDP
//! packet which is then sent to the remote address.
//!
//! Note that this is not currently optimized for performance, especially
//! around buffer management. Rather it's intended to show an example of
//! working with a client.
//!
//! This example can be quite useful when interacting with the other examples in
//! this repository! Many of them recommend running this as a simple "hook up
//! stdin/stdout to a server" to get up and running.

#![warn(rust_2018_idioms)]

use tokio::io::{stdin, stdout};
use tokio::net::UdpSocket;
use tokio_util::codec::{BytesCodec, FramedRead, FramedWrite};

use bytes::Bytes;
use futures::{Sink, SinkExt, Stream, StreamExt};
use std::env;
use std::error::Error;
use std::net::SocketAddr;

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    // Parse what address we're going to connect to
    let args = env::args().skip(1).collect::<Vec<_>>();
    let addr = args
        .first()
        .ok_or("this program requires at least one argument")?;
    let addr = addr.parse::<SocketAddr>()?;

    let stdin = FramedRead::new(stdin(), BytesCodec::new());
    let stdin = stdin.map(|i| i.map(|bytes| bytes.freeze()));
    let stdout = FramedWrite::new(stdout(), BytesCodec::new());

    connect(&addr, stdin, stdout).await?;

    Ok(())
}

pub async fn connect(
    addr: &SocketAddr,
    stdin: impl Stream<Item = Result<Bytes, std::io::Error>> + Unpin,
    stdout: impl Sink<Bytes, Error = std::io::Error> + Unpin,
) -> Result<(), Box<dyn Error>> {
    // We'll bind our UDP socket to a local IP/port, but for now we
    // basically let the OS pick both of those.
    let bind_addr = if addr.ip().is_ipv4() {
        "0.0.0.0:0"
    } else {
        "[::]:0"
    };

    let socket = UdpSocket::bind(&bind_addr).await?;
    socket.connect(addr).await?;

    tokio::select! {
        r = send(stdin, &socket) => r?,
        r = recv(stdout, &socket) => r?,
    }

    Ok(())
}

async fn send(
    mut stdin: impl Stream<Item = Result<Bytes, std::io::Error>> + Unpin,
    writer: &UdpSocket,
) -> Result<(), std::io::Error> {
    while let Some(item) = stdin.next().await {
        let buf = item?;
        writer.send(&buf[..]).await?;
    }

    Ok(())
}

async fn recv(
    mut stdout: impl Sink<Bytes, Error = std::io::Error> + Unpin,
    reader: &UdpSocket,
) -> Result<(), std::io::Error> {
    loop {
        let mut buf = vec![0; 1024];
        let n = reader.recv(&mut buf[..]).await?;

        if n > 0 {
            stdout.send(Bytes::copy_from_slice(&buf[..n])).await?;
        }
    }
}


================================================
FILE: examples/custom-executor-tokio-context.rs
================================================
// This example shows how to use the tokio runtime with any other executor
//
//It takes advantage from RuntimeExt which provides the extension to customize your
//runtime.

use tokio::net::TcpListener;
use tokio::runtime::Builder;
use tokio::sync::oneshot;
use tokio_util::context::RuntimeExt;

fn main() {
    let (tx, rx) = oneshot::channel();
    let rt1 = Builder::new_multi_thread()
        .worker_threads(1)
        // no timer!
        .build()
        .unwrap();
    let rt2 = Builder::new_multi_thread()
        .worker_threads(1)
        .enable_all()
        .build()
        .unwrap();

    // Without the `HandleExt.wrap()` there would be a panic because there is
    // no timer running, since it would be referencing runtime r1.
    rt1.block_on(rt2.wrap(async move {
        let listener = TcpListener::bind("0.0.0.0:0").await.unwrap();
        println!("addr: {:?}", listener.local_addr());
        tx.send(()).unwrap();
    }));
    futures::executor::block_on(rx).unwrap();
}


================================================
FILE: examples/custom-executor.rs
================================================
// This example shows how to use the tokio runtime with any other executor
//
// The main components are a spawn fn that will wrap futures in a special future
// that will always enter the tokio context on poll. This only spawns one extra thread
// to manage and run the tokio drivers in the background.

use tokio::net::TcpListener;
use tokio::sync::oneshot;

fn main() {
    let (tx, rx) = oneshot::channel();

    my_custom_runtime::spawn(async move {
        let listener = TcpListener::bind("0.0.0.0:0").await.unwrap();

        println!("addr: {:?}", listener.local_addr());

        tx.send(()).unwrap();
    });

    futures::executor::block_on(rx).unwrap();
}

mod my_custom_runtime {
    use once_cell::sync::Lazy;
    use std::future::Future;
    use tokio_util::context::TokioContext;

    pub fn spawn(f: impl Future<Output = ()> + Send + 'static) {
        EXECUTOR.spawn(f);
    }

    struct ThreadPool {
        inner: futures::executor::ThreadPool,
        rt: tokio::runtime::Runtime,
    }

    static EXECUTOR: Lazy<ThreadPool> = Lazy::new(|| {
        // Spawn tokio runtime on a single background thread
        // enabling IO and timers.
        let rt = tokio::runtime::Builder::new_multi_thread()
            .enable_all()
            .build()
            .unwrap();
        let inner = futures::executor::ThreadPool::builder().create().unwrap();

        ThreadPool { inner, rt }
    });

    impl ThreadPool {
        fn spawn(&self, f: impl Future<Output = ()> + Send + 'static) {
            let handle = self.rt.handle().clone();
            self.inner.spawn_ok(TokioContext::new(f, handle));
        }
    }
}


================================================
FILE: examples/dump.rs
================================================
//! This example demonstrates tokio's experimental task dumping functionality.
//! This application deadlocks. Input CTRL+C to display traces of each task, or
//! input CTRL+C twice within 1 second to quit.

#[cfg(all(
    tokio_unstable,
    target_os = "linux",
    any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64")
))]
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    use std::sync::Arc;
    use tokio::sync::Barrier;

    #[inline(never)]
    async fn a(barrier: Arc<Barrier>) {
        b(barrier).await
    }

    #[inline(never)]
    async fn b(barrier: Arc<Barrier>) {
        c(barrier).await
    }

    #[inline(never)]
    async fn c(barrier: Arc<Barrier>) {
        barrier.wait().await;
    }

    // Prints a task dump upon receipt of CTRL+C, or returns if CTRL+C is
    // inputted twice within a second.
    async fn dump_or_quit() {
        use tokio::time::{timeout, Duration, Instant};
        let handle = tokio::runtime::Handle::current();
        let mut last_signal: Option<Instant> = None;
        // wait for CTRL+C
        while let Ok(_) = tokio::signal::ctrl_c().await {
            // exit if a CTRL+C is inputted twice within 1 second
            if let Some(time_since_last_signal) = last_signal.map(|i| i.elapsed()) {
                if time_since_last_signal < Duration::from_secs(1) {
                    return;
                }
            }
            last_signal = Some(Instant::now());

            // capture a dump, and print each trace
            println!("{:-<80}", "");
            if let Ok(dump) = timeout(Duration::from_secs(2), handle.dump()).await {
                for task in dump.tasks().iter() {
                    let id = task.id();
            
Download .txt
gitextract_ww3yh_j1/

├── .cirrus.yml
├── .github/
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   ├── config.yml
│   │   └── feature_request.md
│   ├── PULL_REQUEST_TEMPLATE.md
│   ├── buildomat/
│   │   ├── README.md
│   │   └── config.toml
│   ├── labeler.yml
│   └── workflows/
│       ├── audit.yml
│       ├── ci.yml
│       ├── labeler.yml
│       ├── loom.yml
│       ├── pr-audit.yml
│       ├── stress-test.yml
│       └── uring-kernel-version-test.yml
├── .gitignore
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Cargo.toml
├── Cross.toml
├── LICENSE
├── README.md
├── SECURITY.md
├── benches/
│   ├── Cargo.toml
│   ├── copy.rs
│   ├── fs.rs
│   ├── remote_spawn.rs
│   ├── rt_current_thread.rs
│   ├── rt_multi_threaded.rs
│   ├── signal.rs
│   ├── spawn.rs
│   ├── spawn_blocking.rs
│   ├── sync_broadcast.rs
│   ├── sync_mpsc.rs
│   ├── sync_mpsc_oneshot.rs
│   ├── sync_notify.rs
│   ├── sync_rwlock.rs
│   ├── sync_semaphore.rs
│   ├── sync_watch.rs
│   ├── time_now.rs
│   └── time_timeout.rs
├── deny.toml
├── docs/
│   └── contributing/
│       ├── README.md
│       ├── contributing-in-issues.md
│       ├── how-to-specify-crates-dependencies-versions.md
│       ├── keeping-track-of-issues-and-prs.md
│       ├── pull-requests.md
│       └── reviewing-pull-requests.md
├── examples/
│   ├── Cargo.toml
│   ├── README.md
│   ├── chat.rs
│   ├── connect-tcp.rs
│   ├── connect-udp.rs
│   ├── custom-executor-tokio-context.rs
│   ├── custom-executor.rs
│   ├── dump.rs
│   ├── echo-tcp.rs
│   ├── echo-udp.rs
│   ├── hello_world.rs
│   ├── named-pipe-multi-client.rs
│   ├── named-pipe-ready.rs
│   ├── named-pipe.rs
│   ├── print_each_packet.rs
│   ├── proxy.rs
│   ├── tinydb.rs
│   ├── tinyhttp.rs
│   ├── udp-client.rs
│   └── udp-codec.rs
├── netlify.toml
├── spellcheck.dic
├── spellcheck.toml
├── stress-test/
│   ├── Cargo.toml
│   └── examples/
│       └── simple_echo_tcp.rs
├── target-specs/
│   ├── README.md
│   └── i686-unknown-linux-gnu.json
├── tests-build/
│   ├── Cargo.toml
│   ├── README.md
│   ├── src/
│   │   └── lib.rs
│   └── tests/
│       ├── fail/
│       │   ├── macros_core_no_default.rs
│       │   ├── macros_core_no_default.stderr
│       │   ├── macros_dead_code.rs
│       │   ├── macros_dead_code.stderr
│       │   ├── macros_invalid_input.rs
│       │   ├── macros_invalid_input.stderr
│       │   ├── macros_join.rs
│       │   ├── macros_join.stderr
│       │   ├── macros_try_join.rs
│       │   ├── macros_try_join.stderr
│       │   ├── macros_type_mismatch.rs
│       │   └── macros_type_mismatch.stderr
│       ├── macros.rs
│       ├── macros_clippy.rs
│       └── pass/
│           ├── forward_args_and_output.rs
│           ├── impl_trait.rs
│           ├── macros_main_loop.rs
│           ├── macros_main_return.rs
│           └── use_builder_outer.rs
├── tests-integration/
│   ├── Cargo.toml
│   ├── README.md
│   ├── src/
│   │   ├── bin/
│   │   │   ├── test-cat.rs
│   │   │   ├── test-mem.rs
│   │   │   └── test-process-signal.rs
│   │   └── lib.rs
│   └── tests/
│       ├── macros_main.rs
│       ├── macros_pin.rs
│       ├── macros_select.rs
│       ├── process_stdio.rs
│       └── rt_yield.rs
├── tokio/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE
│   ├── README.md
│   ├── docs/
│   │   └── reactor-refactor.md
│   ├── fuzz/
│   │   ├── .gitignore
│   │   ├── Cargo.toml
│   │   └── fuzz_targets/
│   │       └── fuzz_linked_list.rs
│   ├── src/
│   │   ├── blocking.rs
│   │   ├── doc/
│   │   │   ├── mod.rs
│   │   │   └── os.rs
│   │   ├── fs/
│   │   │   ├── canonicalize.rs
│   │   │   ├── copy.rs
│   │   │   ├── create_dir.rs
│   │   │   ├── create_dir_all.rs
│   │   │   ├── dir_builder.rs
│   │   │   ├── file/
│   │   │   │   └── tests.rs
│   │   │   ├── file.rs
│   │   │   ├── hard_link.rs
│   │   │   ├── metadata.rs
│   │   │   ├── mocks.rs
│   │   │   ├── mod.rs
│   │   │   ├── open_options/
│   │   │   │   ├── mock_open_options.rs
│   │   │   │   └── uring_open_options.rs
│   │   │   ├── open_options.rs
│   │   │   ├── read.rs
│   │   │   ├── read_dir.rs
│   │   │   ├── read_link.rs
│   │   │   ├── read_to_string.rs
│   │   │   ├── read_uring.rs
│   │   │   ├── remove_dir.rs
│   │   │   ├── remove_dir_all.rs
│   │   │   ├── remove_file.rs
│   │   │   ├── rename.rs
│   │   │   ├── set_permissions.rs
│   │   │   ├── symlink.rs
│   │   │   ├── symlink_dir.rs
│   │   │   ├── symlink_file.rs
│   │   │   ├── symlink_metadata.rs
│   │   │   ├── try_exists.rs
│   │   │   └── write.rs
│   │   ├── future/
│   │   │   ├── block_on.rs
│   │   │   ├── maybe_done.rs
│   │   │   ├── mod.rs
│   │   │   ├── trace.rs
│   │   │   └── try_join.rs
│   │   ├── fuzz.rs
│   │   ├── io/
│   │   │   ├── async_buf_read.rs
│   │   │   ├── async_fd.rs
│   │   │   ├── async_read.rs
│   │   │   ├── async_seek.rs
│   │   │   ├── async_write.rs
│   │   │   ├── blocking.rs
│   │   │   ├── bsd/
│   │   │   │   └── poll_aio.rs
│   │   │   ├── interest.rs
│   │   │   ├── join.rs
│   │   │   ├── mod.rs
│   │   │   ├── poll_evented.rs
│   │   │   ├── read_buf.rs
│   │   │   ├── ready.rs
│   │   │   ├── seek.rs
│   │   │   ├── split.rs
│   │   │   ├── stderr.rs
│   │   │   ├── stdin.rs
│   │   │   ├── stdio_common.rs
│   │   │   ├── stdout.rs
│   │   │   ├── uring/
│   │   │   │   ├── mod.rs
│   │   │   │   ├── open.rs
│   │   │   │   ├── read.rs
│   │   │   │   ├── utils.rs
│   │   │   │   └── write.rs
│   │   │   └── util/
│   │   │       ├── async_buf_read_ext.rs
│   │   │       ├── async_read_ext.rs
│   │   │       ├── async_seek_ext.rs
│   │   │       ├── async_write_ext.rs
│   │   │       ├── buf_reader.rs
│   │   │       ├── buf_stream.rs
│   │   │       ├── buf_writer.rs
│   │   │       ├── chain.rs
│   │   │       ├── copy.rs
│   │   │       ├── copy_bidirectional.rs
│   │   │       ├── copy_buf.rs
│   │   │       ├── empty.rs
│   │   │       ├── fill_buf.rs
│   │   │       ├── flush.rs
│   │   │       ├── lines.rs
│   │   │       ├── mem.rs
│   │   │       ├── mod.rs
│   │   │       ├── read.rs
│   │   │       ├── read_buf.rs
│   │   │       ├── read_exact.rs
│   │   │       ├── read_int.rs
│   │   │       ├── read_line.rs
│   │   │       ├── read_to_end.rs
│   │   │       ├── read_to_string.rs
│   │   │       ├── read_until.rs
│   │   │       ├── repeat.rs
│   │   │       ├── shutdown.rs
│   │   │       ├── sink.rs
│   │   │       ├── split.rs
│   │   │       ├── take.rs
│   │   │       ├── vec_with_initialized.rs
│   │   │       ├── write.rs
│   │   │       ├── write_all.rs
│   │   │       ├── write_all_buf.rs
│   │   │       ├── write_buf.rs
│   │   │       ├── write_int.rs
│   │   │       └── write_vectored.rs
│   │   ├── lib.rs
│   │   ├── loom/
│   │   │   ├── mocked.rs
│   │   │   ├── mod.rs
│   │   │   └── std/
│   │   │       ├── atomic_u16.rs
│   │   │       ├── atomic_u32.rs
│   │   │       ├── atomic_u64.rs
│   │   │       ├── atomic_u64_as_mutex.rs
│   │   │       ├── atomic_u64_native.rs
│   │   │       ├── atomic_u64_static_const_new.rs
│   │   │       ├── atomic_u64_static_once_cell.rs
│   │   │       ├── atomic_usize.rs
│   │   │       ├── barrier.rs
│   │   │       ├── mod.rs
│   │   │       ├── mutex.rs
│   │   │       ├── parking_lot.rs
│   │   │       ├── rwlock.rs
│   │   │       └── unsafe_cell.rs
│   │   ├── macros/
│   │   │   ├── addr_of.rs
│   │   │   ├── cfg.rs
│   │   │   ├── join.rs
│   │   │   ├── loom.rs
│   │   │   ├── mod.rs
│   │   │   ├── pin.rs
│   │   │   ├── select.rs
│   │   │   ├── support.rs
│   │   │   ├── thread_local.rs
│   │   │   ├── trace.rs
│   │   │   └── try_join.rs
│   │   ├── net/
│   │   │   ├── addr.rs
│   │   │   ├── lookup_host.rs
│   │   │   ├── mod.rs
│   │   │   ├── tcp/
│   │   │   │   ├── listener.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── socket.rs
│   │   │   │   ├── split.rs
│   │   │   │   ├── split_owned.rs
│   │   │   │   └── stream.rs
│   │   │   ├── udp.rs
│   │   │   ├── unix/
│   │   │   │   ├── datagram/
│   │   │   │   │   ├── mod.rs
│   │   │   │   │   └── socket.rs
│   │   │   │   ├── listener.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── pipe.rs
│   │   │   │   ├── socket.rs
│   │   │   │   ├── socketaddr.rs
│   │   │   │   ├── split.rs
│   │   │   │   ├── split_owned.rs
│   │   │   │   ├── stream.rs
│   │   │   │   └── ucred.rs
│   │   │   └── windows/
│   │   │       ├── mod.rs
│   │   │       └── named_pipe.rs
│   │   ├── process/
│   │   │   ├── kill.rs
│   │   │   ├── mod.rs
│   │   │   ├── unix/
│   │   │   │   ├── mod.rs
│   │   │   │   ├── orphan.rs
│   │   │   │   ├── pidfd_reaper.rs
│   │   │   │   └── reap.rs
│   │   │   └── windows.rs
│   │   ├── runtime/
│   │   │   ├── blocking/
│   │   │   │   ├── mod.rs
│   │   │   │   ├── pool.rs
│   │   │   │   ├── schedule.rs
│   │   │   │   ├── shutdown.rs
│   │   │   │   └── task.rs
│   │   │   ├── builder.rs
│   │   │   ├── config.rs
│   │   │   ├── context/
│   │   │   │   ├── blocking.rs
│   │   │   │   ├── current.rs
│   │   │   │   ├── runtime.rs
│   │   │   │   ├── runtime_mt.rs
│   │   │   │   └── scoped.rs
│   │   │   ├── context.rs
│   │   │   ├── driver/
│   │   │   │   └── op.rs
│   │   │   ├── driver.rs
│   │   │   ├── dump.rs
│   │   │   ├── handle.rs
│   │   │   ├── id.rs
│   │   │   ├── io/
│   │   │   │   ├── driver/
│   │   │   │   │   ├── signal.rs
│   │   │   │   │   └── uring.rs
│   │   │   │   ├── driver.rs
│   │   │   │   ├── metrics.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── registration.rs
│   │   │   │   ├── registration_set.rs
│   │   │   │   └── scheduled_io.rs
│   │   │   ├── local_runtime/
│   │   │   │   ├── mod.rs
│   │   │   │   ├── options.rs
│   │   │   │   └── runtime.rs
│   │   │   ├── metrics/
│   │   │   │   ├── batch.rs
│   │   │   │   ├── histogram/
│   │   │   │   │   └── h2_histogram.rs
│   │   │   │   ├── histogram.rs
│   │   │   │   ├── io.rs
│   │   │   │   ├── mock.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── runtime.rs
│   │   │   │   ├── scheduler.rs
│   │   │   │   └── worker.rs
│   │   │   ├── mod.rs
│   │   │   ├── park.rs
│   │   │   ├── process.rs
│   │   │   ├── runtime.rs
│   │   │   ├── scheduler/
│   │   │   │   ├── block_in_place.rs
│   │   │   │   ├── current_thread/
│   │   │   │   │   └── mod.rs
│   │   │   │   ├── defer.rs
│   │   │   │   ├── inject/
│   │   │   │   │   ├── metrics.rs
│   │   │   │   │   ├── pop.rs
│   │   │   │   │   ├── rt_multi_thread.rs
│   │   │   │   │   ├── shared.rs
│   │   │   │   │   └── synced.rs
│   │   │   │   ├── inject.rs
│   │   │   │   ├── lock.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── multi_thread/
│   │   │   │   │   ├── counters.rs
│   │   │   │   │   ├── handle/
│   │   │   │   │   │   ├── metrics.rs
│   │   │   │   │   │   └── taskdump.rs
│   │   │   │   │   ├── handle.rs
│   │   │   │   │   ├── idle.rs
│   │   │   │   │   ├── mod.rs
│   │   │   │   │   ├── overflow.rs
│   │   │   │   │   ├── park.rs
│   │   │   │   │   ├── queue.rs
│   │   │   │   │   ├── stats.rs
│   │   │   │   │   ├── trace.rs
│   │   │   │   │   ├── trace_mock.rs
│   │   │   │   │   ├── worker/
│   │   │   │   │   │   ├── metrics.rs
│   │   │   │   │   │   ├── taskdump.rs
│   │   │   │   │   │   └── taskdump_mock.rs
│   │   │   │   │   └── worker.rs
│   │   │   │   └── util/
│   │   │   │       ├── mod.rs
│   │   │   │       └── time_alt.rs
│   │   │   ├── signal/
│   │   │   │   └── mod.rs
│   │   │   ├── task/
│   │   │   │   ├── abort.rs
│   │   │   │   ├── core.rs
│   │   │   │   ├── error.rs
│   │   │   │   ├── harness.rs
│   │   │   │   ├── id.rs
│   │   │   │   ├── join.rs
│   │   │   │   ├── list.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── raw.rs
│   │   │   │   ├── state.rs
│   │   │   │   ├── trace/
│   │   │   │   │   ├── mod.rs
│   │   │   │   │   ├── symbol.rs
│   │   │   │   │   └── tree.rs
│   │   │   │   └── waker.rs
│   │   │   ├── task_hooks.rs
│   │   │   ├── tests/
│   │   │   │   ├── inject.rs
│   │   │   │   ├── loom_blocking.rs
│   │   │   │   ├── loom_current_thread/
│   │   │   │   │   └── yield_now.rs
│   │   │   │   ├── loom_current_thread.rs
│   │   │   │   ├── loom_join_set.rs
│   │   │   │   ├── loom_local.rs
│   │   │   │   ├── loom_multi_thread/
│   │   │   │   │   ├── queue.rs
│   │   │   │   │   ├── shutdown.rs
│   │   │   │   │   └── yield_now.rs
│   │   │   │   ├── loom_multi_thread.rs
│   │   │   │   ├── loom_oneshot.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── queue.rs
│   │   │   │   ├── task.rs
│   │   │   │   └── task_combinations.rs
│   │   │   ├── thread_id.rs
│   │   │   ├── time/
│   │   │   │   ├── entry.rs
│   │   │   │   ├── handle.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── source.rs
│   │   │   │   ├── tests/
│   │   │   │   │   └── mod.rs
│   │   │   │   └── wheel/
│   │   │   │       ├── level.rs
│   │   │   │       └── mod.rs
│   │   │   └── time_alt/
│   │   │       ├── cancellation_queue/
│   │   │       │   └── tests.rs
│   │   │       ├── cancellation_queue.rs
│   │   │       ├── context.rs
│   │   │       ├── entry.rs
│   │   │       ├── mod.rs
│   │   │       ├── registration_queue/
│   │   │       │   └── tests.rs
│   │   │       ├── registration_queue.rs
│   │   │       ├── tests.rs
│   │   │       ├── timer.rs
│   │   │       ├── wake_queue/
│   │   │       │   └── tests.rs
│   │   │       ├── wake_queue.rs
│   │   │       └── wheel/
│   │   │           ├── level.rs
│   │   │           └── mod.rs
│   │   ├── signal/
│   │   │   ├── ctrl_c.rs
│   │   │   ├── mod.rs
│   │   │   ├── registry.rs
│   │   │   ├── reusable_box.rs
│   │   │   ├── unix.rs
│   │   │   ├── windows/
│   │   │   │   ├── stub.rs
│   │   │   │   └── sys.rs
│   │   │   └── windows.rs
│   │   ├── sync/
│   │   │   ├── barrier.rs
│   │   │   ├── batch_semaphore.rs
│   │   │   ├── broadcast.rs
│   │   │   ├── mod.rs
│   │   │   ├── mpsc/
│   │   │   │   ├── block.rs
│   │   │   │   ├── bounded.rs
│   │   │   │   ├── chan.rs
│   │   │   │   ├── error.rs
│   │   │   │   ├── list.rs
│   │   │   │   ├── mod.rs
│   │   │   │   └── unbounded.rs
│   │   │   ├── mutex.rs
│   │   │   ├── notify.rs
│   │   │   ├── once_cell.rs
│   │   │   ├── oneshot.rs
│   │   │   ├── rwlock/
│   │   │   │   ├── owned_read_guard.rs
│   │   │   │   ├── owned_write_guard.rs
│   │   │   │   ├── owned_write_guard_mapped.rs
│   │   │   │   ├── read_guard.rs
│   │   │   │   ├── write_guard.rs
│   │   │   │   └── write_guard_mapped.rs
│   │   │   ├── rwlock.rs
│   │   │   ├── semaphore.rs
│   │   │   ├── set_once.rs
│   │   │   ├── task/
│   │   │   │   ├── atomic_waker.rs
│   │   │   │   └── mod.rs
│   │   │   ├── tests/
│   │   │   │   ├── atomic_waker.rs
│   │   │   │   ├── loom_atomic_waker.rs
│   │   │   │   ├── loom_broadcast.rs
│   │   │   │   ├── loom_list.rs
│   │   │   │   ├── loom_mpsc.rs
│   │   │   │   ├── loom_notify.rs
│   │   │   │   ├── loom_oneshot.rs
│   │   │   │   ├── loom_rwlock.rs
│   │   │   │   ├── loom_semaphore_batch.rs
│   │   │   │   ├── loom_set_once.rs
│   │   │   │   ├── loom_watch.rs
│   │   │   │   ├── mod.rs
│   │   │   │   ├── notify.rs
│   │   │   │   └── semaphore_batch.rs
│   │   │   └── watch.rs
│   │   ├── task/
│   │   │   ├── blocking.rs
│   │   │   ├── builder.rs
│   │   │   ├── coop/
│   │   │   │   ├── consume_budget.rs
│   │   │   │   ├── mod.rs
│   │   │   │   └── unconstrained.rs
│   │   │   ├── join_set.rs
│   │   │   ├── local.rs
│   │   │   ├── mod.rs
│   │   │   ├── spawn.rs
│   │   │   ├── task_local.rs
│   │   │   └── yield_now.rs
│   │   ├── time/
│   │   │   ├── clock.rs
│   │   │   ├── error.rs
│   │   │   ├── instant.rs
│   │   │   ├── interval.rs
│   │   │   ├── mod.rs
│   │   │   ├── sleep.rs
│   │   │   └── timeout.rs
│   │   └── util/
│   │       ├── as_ref.rs
│   │       ├── atomic_cell.rs
│   │       ├── bit.rs
│   │       ├── blocking_check.rs
│   │       ├── cacheline.rs
│   │       ├── error.rs
│   │       ├── idle_notified_set.rs
│   │       ├── linked_list.rs
│   │       ├── markers.rs
│   │       ├── memchr.rs
│   │       ├── metric_atomics.rs
│   │       ├── mod.rs
│   │       ├── ptr_expose.rs
│   │       ├── rand/
│   │       │   ├── rt.rs
│   │       │   └── rt_unstable.rs
│   │       ├── rand.rs
│   │       ├── rc_cell.rs
│   │       ├── sharded_list.rs
│   │       ├── sync_wrapper.rs
│   │       ├── trace.rs
│   │       ├── try_lock.rs
│   │       ├── typeid.rs
│   │       ├── wake.rs
│   │       └── wake_list.rs
│   └── tests/
│       ├── _require_full.rs
│       ├── async_send_sync.rs
│       ├── buffered.rs
│       ├── coop_budget.rs
│       ├── dump.rs
│       ├── duplex_stream.rs
│       ├── fs.rs
│       ├── fs_canonicalize_dir.rs
│       ├── fs_copy.rs
│       ├── fs_dir.rs
│       ├── fs_file.rs
│       ├── fs_link.rs
│       ├── fs_open_options.rs
│       ├── fs_open_options_windows.rs
│       ├── fs_remove_dir_all.rs
│       ├── fs_remove_file.rs
│       ├── fs_rename.rs
│       ├── fs_symlink_dir_windows.rs
│       ├── fs_symlink_file_windows.rs
│       ├── fs_try_exists.rs
│       ├── fs_uring.rs
│       ├── fs_uring_read.rs
│       ├── fs_write.rs
│       ├── io_async_fd.rs
│       ├── io_async_fd_memory_leak.rs
│       ├── io_async_read.rs
│       ├── io_buf_reader.rs
│       ├── io_buf_writer.rs
│       ├── io_chain.rs
│       ├── io_copy.rs
│       ├── io_copy_bidirectional.rs
│       ├── io_driver.rs
│       ├── io_driver_drop.rs
│       ├── io_fill_buf.rs
│       ├── io_join.rs
│       ├── io_lines.rs
│       ├── io_mem_stream.rs
│       ├── io_panic.rs
│       ├── io_poll_aio.rs
│       ├── io_read.rs
│       ├── io_read_buf.rs
│       ├── io_read_exact.rs
│       ├── io_read_line.rs
│       ├── io_read_to_end.rs
│       ├── io_read_to_string.rs
│       ├── io_read_until.rs
│       ├── io_repeat.rs
│       ├── io_sink.rs
│       ├── io_split.rs
│       ├── io_take.rs
│       ├── io_util_empty.rs
│       ├── io_write.rs
│       ├── io_write_all.rs
│       ├── io_write_all_buf.rs
│       ├── io_write_buf.rs
│       ├── io_write_int.rs
│       ├── join_handle_panic.rs
│       ├── macros_join.rs
│       ├── macros_pin.rs
│       ├── macros_rename_test.rs
│       ├── macros_select.rs
│       ├── macros_test.rs
│       ├── macros_try_join.rs
│       ├── net_bind_resource.rs
│       ├── net_lookup_host.rs
│       ├── net_named_pipe.rs
│       ├── net_panic.rs
│       ├── net_quickack.rs
│       ├── net_unix_pipe.rs
│       ├── no_rt.rs
│       ├── process_arg0.rs
│       ├── process_change_of_runtime.rs
│       ├── process_issue_2174.rs
│       ├── process_issue_42.rs
│       ├── process_issue_7144.rs
│       ├── process_kill_after_wait.rs
│       ├── process_kill_on_drop.rs
│       ├── process_raw_handle.rs
│       ├── process_smoke.rs
│       ├── rt_basic.rs
│       ├── rt_common.rs
│       ├── rt_common_before_park.rs
│       ├── rt_handle.rs
│       ├── rt_handle_block_on.rs
│       ├── rt_local.rs
│       ├── rt_metrics.rs
│       ├── rt_panic.rs
│       ├── rt_poll_callbacks.rs
│       ├── rt_shutdown_err.rs
│       ├── rt_threaded.rs
│       ├── rt_time_start_paused.rs
│       ├── rt_unstable_metrics.rs
│       ├── rt_worker_index.rs
│       ├── signal_ctrl_c.rs
│       ├── signal_drop_recv.rs
│       ├── signal_drop_rt.rs
│       ├── signal_drop_signal.rs
│       ├── signal_info.rs
│       ├── signal_multi_rt.rs
│       ├── signal_no_rt.rs
│       ├── signal_notify_both.rs
│       ├── signal_panic.rs
│       ├── signal_realtime.rs
│       ├── signal_twice.rs
│       ├── signal_usr1.rs
│       ├── support/
│       │   ├── io_vec.rs
│       │   ├── leaked_buffers.rs
│       │   ├── mpsc_stream.rs
│       │   ├── panic.rs
│       │   └── signal.rs
│       ├── sync_barrier.rs
│       ├── sync_broadcast.rs
│       ├── sync_broadcast_weak.rs
│       ├── sync_errors.rs
│       ├── sync_mpsc.rs
│       ├── sync_mpsc_weak.rs
│       ├── sync_mutex.rs
│       ├── sync_mutex_owned.rs
│       ├── sync_notify.rs
│       ├── sync_notify_owned.rs
│       ├── sync_once_cell.rs
│       ├── sync_oneshot.rs
│       ├── sync_panic.rs
│       ├── sync_rwlock.rs
│       ├── sync_semaphore.rs
│       ├── sync_semaphore_owned.rs
│       ├── sync_set_once.rs
│       ├── sync_watch.rs
│       ├── task_abort.rs
│       ├── task_blocking.rs
│       ├── task_builder.rs
│       ├── task_hooks.rs
│       ├── task_id.rs
│       ├── task_join_set.rs
│       ├── task_local.rs
│       ├── task_local_set.rs
│       ├── task_panic.rs
│       ├── task_trace_self.rs
│       ├── task_yield_now.rs
│       ├── tcp_accept.rs
│       ├── tcp_connect.rs
│       ├── tcp_echo.rs
│       ├── tcp_into_split.rs
│       ├── tcp_into_std.rs
│       ├── tcp_peek.rs
│       ├── tcp_shutdown.rs
│       ├── tcp_socket.rs
│       ├── tcp_split.rs
│       ├── tcp_stream.rs
│       ├── test_clock.rs
│       ├── time_alt.rs
│       ├── time_interval.rs
│       ├── time_panic.rs
│       ├── time_pause.rs
│       ├── time_rt.rs
│       ├── time_sleep.rs
│       ├── time_timeout.rs
│       ├── time_wasm.rs
│       ├── tracing_sync.rs
│       ├── tracing_task.rs
│       ├── tracing_time.rs
│       ├── udp.rs
│       ├── uds_cred.rs
│       ├── uds_datagram.rs
│       ├── uds_socket.rs
│       ├── uds_split.rs
│       ├── uds_stream.rs
│       └── unwindsafe.rs
├── tokio-macros/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE
│   ├── README.md
│   └── src/
│       ├── entry.rs
│       ├── lib.rs
│       └── select.rs
├── tokio-stream/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE
│   ├── README.md
│   ├── fuzz/
│   │   ├── .gitignore
│   │   ├── Cargo.toml
│   │   └── fuzz_targets/
│   │       └── fuzz_stream_map.rs
│   ├── src/
│   │   ├── empty.rs
│   │   ├── iter.rs
│   │   ├── lib.rs
│   │   ├── macros.rs
│   │   ├── once.rs
│   │   ├── pending.rs
│   │   ├── stream_close.rs
│   │   ├── stream_ext/
│   │   │   ├── all.rs
│   │   │   ├── any.rs
│   │   │   ├── chain.rs
│   │   │   ├── chunks_timeout.rs
│   │   │   ├── collect.rs
│   │   │   ├── filter.rs
│   │   │   ├── filter_map.rs
│   │   │   ├── fold.rs
│   │   │   ├── fuse.rs
│   │   │   ├── map.rs
│   │   │   ├── map_while.rs
│   │   │   ├── merge.rs
│   │   │   ├── next.rs
│   │   │   ├── peekable.rs
│   │   │   ├── skip.rs
│   │   │   ├── skip_while.rs
│   │   │   ├── take.rs
│   │   │   ├── take_while.rs
│   │   │   ├── then.rs
│   │   │   ├── throttle.rs
│   │   │   ├── timeout.rs
│   │   │   ├── timeout_repeating.rs
│   │   │   └── try_next.rs
│   │   ├── stream_ext.rs
│   │   ├── stream_map.rs
│   │   ├── wrappers/
│   │   │   ├── broadcast.rs
│   │   │   ├── interval.rs
│   │   │   ├── lines.rs
│   │   │   ├── mpsc_bounded.rs
│   │   │   ├── mpsc_unbounded.rs
│   │   │   ├── read_dir.rs
│   │   │   ├── signal_unix.rs
│   │   │   ├── signal_windows.rs
│   │   │   ├── split.rs
│   │   │   ├── tcp_listener.rs
│   │   │   ├── unix_listener.rs
│   │   │   └── watch.rs
│   │   └── wrappers.rs
│   └── tests/
│       ├── async_send_sync.rs
│       ├── chunks_timeout.rs
│       ├── mpsc_bounded_stream.rs
│       ├── mpsc_unbounded_stream.rs
│       ├── stream_chain.rs
│       ├── stream_chunks_timeout.rs
│       ├── stream_close.rs
│       ├── stream_collect.rs
│       ├── stream_empty.rs
│       ├── stream_fuse.rs
│       ├── stream_iter.rs
│       ├── stream_merge.rs
│       ├── stream_once.rs
│       ├── stream_panic.rs
│       ├── stream_pending.rs
│       ├── stream_stream_map.rs
│       ├── stream_timeout.rs
│       ├── support/
│       │   └── mpsc.rs
│       ├── time_throttle.rs
│       └── watch.rs
├── tokio-test/
│   ├── CHANGELOG.md
│   ├── Cargo.toml
│   ├── LICENSE
│   ├── README.md
│   ├── src/
│   │   ├── io.rs
│   │   ├── lib.rs
│   │   ├── macros.rs
│   │   ├── stream_mock.rs
│   │   └── task.rs
│   └── tests/
│       ├── block_on.rs
│       ├── io.rs
│       ├── macros.rs
│       ├── stream_mock.rs
│       └── task.rs
└── tokio-util/
    ├── CHANGELOG.md
    ├── Cargo.toml
    ├── LICENSE
    ├── README.md
    ├── src/
    │   ├── cfg.rs
    │   ├── codec/
    │   │   ├── any_delimiter_codec.rs
    │   │   ├── bytes_codec.rs
    │   │   ├── decoder.rs
    │   │   ├── encoder.rs
    │   │   ├── framed.rs
    │   │   ├── framed_impl.rs
    │   │   ├── framed_read.rs
    │   │   ├── framed_write.rs
    │   │   ├── length_delimited.rs
    │   │   ├── lines_codec.rs
    │   │   └── mod.rs
    │   ├── compat.rs
    │   ├── context.rs
    │   ├── either.rs
    │   ├── future/
    │   │   └── with_cancellation_token.rs
    │   ├── future.rs
    │   ├── io/
    │   │   ├── copy_to_bytes.rs
    │   │   ├── inspect.rs
    │   │   ├── mod.rs
    │   │   ├── read_arc.rs
    │   │   ├── read_buf.rs
    │   │   ├── reader_stream.rs
    │   │   ├── simplex.rs
    │   │   ├── sink_writer.rs
    │   │   ├── stream_reader.rs
    │   │   ├── sync_bridge.rs
    │   │   └── write_all_vectored.rs
    │   ├── lib.rs
    │   ├── loom.rs
    │   ├── net/
    │   │   ├── mod.rs
    │   │   └── unix/
    │   │       └── mod.rs
    │   ├── sync/
    │   │   ├── cancellation_token/
    │   │   │   ├── guard.rs
    │   │   │   ├── guard_ref.rs
    │   │   │   └── tree_node.rs
    │   │   ├── cancellation_token.rs
    │   │   ├── mod.rs
    │   │   ├── mpsc.rs
    │   │   ├── poll_semaphore.rs
    │   │   ├── reusable_box.rs
    │   │   └── tests/
    │   │       ├── loom_cancellation_token.rs
    │   │       └── mod.rs
    │   ├── task/
    │   │   ├── abort_on_drop.rs
    │   │   ├── join_map.rs
    │   │   ├── join_queue.rs
    │   │   ├── mod.rs
    │   │   ├── spawn_pinned.rs
    │   │   └── task_tracker.rs
    │   ├── time/
    │   │   ├── delay_queue.rs
    │   │   ├── mod.rs
    │   │   └── wheel/
    │   │       ├── level.rs
    │   │       ├── mod.rs
    │   │       └── stack.rs
    │   ├── tracing.rs
    │   ├── udp/
    │   │   ├── frame.rs
    │   │   └── mod.rs
    │   └── util/
    │       ├── maybe_dangling.rs
    │       ├── mod.rs
    │       └── poll_buf.rs
    └── tests/
        ├── _require_full.rs
        ├── abort_on_drop.rs
        ├── codecs.rs
        ├── compat.rs
        ├── context.rs
        ├── framed.rs
        ├── framed_read.rs
        ├── framed_stream.rs
        ├── framed_write.rs
        ├── future.rs
        ├── io_inspect.rs
        ├── io_reader_stream.rs
        ├── io_simplex.rs
        ├── io_sink_writer.rs
        ├── io_stream_reader.rs
        ├── io_sync_bridge.rs
        ├── io_write_all_vectored.rs
        ├── length_delimited.rs
        ├── mpsc.rs
        ├── panic.rs
        ├── poll_semaphore.rs
        ├── reusable_box.rs
        ├── spawn_pinned.rs
        ├── sync_cancellation_token.rs
        ├── task_join_map.rs
        ├── task_join_queue.rs
        ├── task_tracker.rs
        ├── time_delay_queue.rs
        └── udp.rs
Download .txt
Showing preview only (662K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (7948 symbols across 701 files)

FILE: benches/copy.rs
  constant KILO (line 12) | const KILO: usize = 1024;
  constant RNG_SEED (line 17) | const RNG_SEED: u64 = 0;
  constant SOURCE_SIZE (line 19) | const SOURCE_SIZE: u64 = 256 * KILO as u64;
  constant CHUNK_SIZE (line 22) | const CHUNK_SIZE: usize = 2 * KILO;
  constant READ_SERVICE_PERIOD (line 23) | const READ_SERVICE_PERIOD: Duration = Duration::from_millis(1);
  constant WRITE_BUFFER (line 26) | const WRITE_BUFFER: usize = 40 * KILO;
  constant WRITE_SERVICE_PERIOD (line 27) | const WRITE_SERVICE_PERIOD: Duration = Duration::from_millis(20);
  constant PROBABILITY_FLUSH_WAIT (line 30) | const PROBABILITY_FLUSH_WAIT: f64 = 0.1;
  type SlowHddWriter (line 41) | struct SlowHddWriter {
    method new (line 49) | fn new(service_interval: Duration, buffer_size: usize) -> Self {
    method service_write (line 61) | fn service_write(
    method write_bytes (line 73) | fn write_bytes(
  method poll_write (line 99) | fn poll_write(
  method poll_flush (line 107) | fn poll_flush(
  method poll_shutdown (line 114) | fn poll_shutdown(
  method poll_write_vectored (line 121) | fn poll_write_vectored(
  method is_write_vectored (line 130) | fn is_write_vectored(&self) -> bool {
  type ChunkReader (line 139) | struct ChunkReader {
    method new (line 145) | fn new(chunk_size: usize, service_interval: Duration) -> Self {
  method poll_read (line 157) | fn poll_read(
  function rt (line 170) | fn rt() -> tokio::runtime::Runtime {
  function copy_mem_to_mem (line 177) | fn copy_mem_to_mem(c: &mut Criterion) {
  function copy_mem_to_slow_hdd (line 193) | fn copy_mem_to_slow_hdd(c: &mut Criterion) {
  function copy_chunk_to_mem (line 209) | fn copy_chunk_to_mem(c: &mut Criterion) {
  function copy_chunk_to_slow_hdd (line 226) | fn copy_chunk_to_slow_hdd(c: &mut Criterion) {

FILE: benches/fs.rs
  function rt (line 14) | fn rt() -> tokio::runtime::Runtime {
  constant BLOCK_COUNT (line 21) | const BLOCK_COUNT: usize = 1_000;
  constant BUFFER_SIZE (line 23) | const BUFFER_SIZE: usize = 4096;
  constant DEV_ZERO (line 24) | const DEV_ZERO: &str = "/dev/zero";
  function async_read_codec (line 26) | fn async_read_codec(c: &mut Criterion) {
  function async_read_buf (line 46) | fn async_read_buf(c: &mut Criterion) {
  function async_read_std_file (line 68) | fn async_read_std_file(c: &mut Criterion) {
  function sync_read (line 92) | fn sync_read(c: &mut Criterion) {

FILE: benches/remote_spawn.rs
  constant TOTAL_TASKS (line 21) | const TOTAL_TASKS: usize = 12_800;
  constant _ (line 22) | const _: () = assert!(TOTAL_TASKS % 64 == 0, "TOTAL_TASKS must be divisi...
  function remote_spawn_contention (line 24) | fn remote_spawn_contention(c: &mut Criterion) {
  function parallelism_levels (line 83) | fn parallelism_levels() -> Vec<usize> {
  function rt (line 94) | fn rt() -> Runtime {

FILE: benches/rt_current_thread.rs
  constant NUM_SPAWN (line 9) | const NUM_SPAWN: usize = 1_000;
  function rt_curr_spawn_many_local (line 11) | fn rt_curr_spawn_many_local(c: &mut Criterion) {
  function rt_curr_spawn_many_remote_idle (line 30) | fn rt_curr_spawn_many_remote_idle(c: &mut Criterion) {
  function rt_curr_spawn_many_remote_busy (line 50) | fn rt_curr_spawn_many_remote_busy(c: &mut Criterion) {
  function rt (line 78) | fn rt() -> Runtime {

FILE: benches/rt_multi_threaded.rs
  constant NUM_WORKERS (line 15) | const NUM_WORKERS: usize = 4;
  constant NUM_SPAWN (line 16) | const NUM_SPAWN: usize = 10_000;
  constant STALL_DUR (line 17) | const STALL_DUR: Duration = Duration::from_micros(10);
  function rt_multi_spawn_many_local (line 19) | fn rt_multi_spawn_many_local(c: &mut Criterion) {
  function rt_multi_spawn_many_remote_idle (line 47) | fn rt_multi_spawn_many_remote_idle(c: &mut Criterion) {
  function rt_multi_spawn_many_remote_busy1 (line 69) | fn rt_multi_spawn_many_remote_busy1(c: &mut Criterion) {
  function rt_multi_spawn_many_remote_busy2 (line 105) | fn rt_multi_spawn_many_remote_busy2(c: &mut Criterion) {
  function rt_multi_yield_many (line 146) | fn rt_multi_yield_many(c: &mut Criterion) {
  function rt_multi_ping_pong (line 174) | fn rt_multi_ping_pong(c: &mut Criterion) {
  function rt_multi_chained_spawn (line 219) | fn rt_multi_chained_spawn(c: &mut Criterion) {
  function rt (line 250) | fn rt() -> Runtime {
  function stall (line 258) | fn stall() {

FILE: benches/signal.rs
  type Spinner (line 12) | struct Spinner {
    method new (line 31) | fn new() -> Self {
  type Output (line 17) | type Output = ();
  method poll (line 19) | fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Ou...
  function send_signal (line 36) | pub fn send_signal(signal: libc::c_int) {
  function many_signals (line 44) | fn many_signals(c: &mut Criterion) {

FILE: benches/spawn.rs
  function work (line 7) | async fn work() -> usize {
  function single_rt (line 13) | fn single_rt() -> tokio::runtime::Runtime {
  function multi_rt (line 19) | fn multi_rt() -> tokio::runtime::Runtime {
  function basic_scheduler_spawn (line 26) | fn basic_scheduler_spawn(c: &mut Criterion) {
  function basic_scheduler_spawn10 (line 39) | fn basic_scheduler_spawn10(c: &mut Criterion) {
  function threaded_scheduler_spawn (line 57) | fn threaded_scheduler_spawn(c: &mut Criterion) {
  function threaded_scheduler_spawn10 (line 70) | fn threaded_scheduler_spawn10(c: &mut Criterion) {

FILE: benches/spawn_blocking.rs
  constant NUM_BATCHES (line 13) | const NUM_BATCHES: usize = 100;
  constant BATCH_SIZE (line 15) | const BATCH_SIZE: usize = 16;
  function spawn_blocking_concurrency (line 17) | fn spawn_blocking_concurrency(c: &mut Criterion) {
  function rt (line 64) | fn rt() -> Runtime {

FILE: benches/sync_broadcast.rs
  function rt (line 9) | fn rt() -> tokio::runtime::Runtime {
  function do_work (line 16) | fn do_work(rng: &mut impl RngCore) -> u32 {
  function contention_impl (line 29) | fn contention_impl<const N_TASKS: usize>(g: &mut BenchmarkGroup<WallTime...
  function bench_contention (line 71) | fn bench_contention(c: &mut Criterion) {

FILE: benches/sync_mpsc.rs
  type Medium (line 7) | struct Medium(#[allow(dead_code)] [usize; 64]);
  method default (line 9) | fn default() -> Self {
  type Large (line 15) | struct Large(#[allow(dead_code)] [Medium; 64]);
  method default (line 17) | fn default() -> Self {
  function rt (line 22) | fn rt() -> tokio::runtime::Runtime {
  function create_medium (line 29) | fn create_medium<const SIZE: usize>(g: &mut BenchmarkGroup<WallTime>) {
  function send_data (line 37) | fn send_data<T: Default, const SIZE: usize>(g: &mut BenchmarkGroup<WallT...
  function contention_bounded (line 51) | fn contention_bounded(g: &mut BenchmarkGroup<WallTime>) {
  function contention_bounded_recv_many (line 76) | fn contention_bounded_recv_many(g: &mut BenchmarkGroup<WallTime>) {
  function contention_bounded_full (line 103) | fn contention_bounded_full(g: &mut BenchmarkGroup<WallTime>) {
  function contention_bounded_full_recv_many (line 128) | fn contention_bounded_full_recv_many(g: &mut BenchmarkGroup<WallTime>) {
  function contention_unbounded (line 155) | fn contention_unbounded(g: &mut BenchmarkGroup<WallTime>) {
  function contention_unbounded_recv_many (line 180) | fn contention_unbounded_recv_many(g: &mut BenchmarkGroup<WallTime>) {
  function uncontented_bounded (line 207) | fn uncontented_bounded(g: &mut BenchmarkGroup<WallTime>) {
  function uncontented_bounded_recv_many (line 227) | fn uncontented_bounded_recv_many(g: &mut BenchmarkGroup<WallTime>) {
  function uncontented_unbounded (line 249) | fn uncontented_unbounded(g: &mut BenchmarkGroup<WallTime>) {
  function uncontented_unbounded_recv_many (line 269) | fn uncontented_unbounded_recv_many(g: &mut BenchmarkGroup<WallTime>) {
  function bench_create_medium (line 291) | fn bench_create_medium(c: &mut Criterion) {
  function bench_send (line 299) | fn bench_send(c: &mut Criterion) {
  function bench_contention (line 306) | fn bench_contention(c: &mut Criterion) {
  function bench_uncontented (line 317) | fn bench_uncontented(c: &mut Criterion) {

FILE: benches/sync_mpsc_oneshot.rs
  function request_reply_current_thread (line 8) | fn request_reply_current_thread(c: &mut Criterion) {
  function request_reply_multi_threaded (line 16) | fn request_reply_multi_threaded(c: &mut Criterion) {
  function request_reply (line 25) | fn request_reply(b: &mut Criterion, rt: Runtime) {

FILE: benches/sync_notify.rs
  function rt (line 9) | fn rt() -> tokio::runtime::Runtime {
  function notify_waiters (line 16) | fn notify_waiters<const N_WAITERS: usize>(g: &mut BenchmarkGroup<WallTim...
  function notify_one (line 47) | fn notify_one<const N_WAITERS: usize>(g: &mut BenchmarkGroup<WallTime>) {
  function bench_notify_one (line 78) | fn bench_notify_one(c: &mut Criterion) {
  function bench_notify_waiters (line 88) | fn bench_notify_waiters(c: &mut Criterion) {

FILE: benches/sync_rwlock.rs
  function read_uncontended (line 7) | fn read_uncontended(g: &mut BenchmarkGroup<WallTime>) {
  function read_concurrent_uncontended_multi (line 27) | fn read_concurrent_uncontended_multi(g: &mut BenchmarkGroup<WallTime>) {
  function read_concurrent_uncontended (line 57) | fn read_concurrent_uncontended(g: &mut BenchmarkGroup<WallTime>) {
  function read_concurrent_contended_multi (line 85) | fn read_concurrent_contended_multi(g: &mut BenchmarkGroup<WallTime>) {
  function read_concurrent_contended (line 116) | fn read_concurrent_contended(g: &mut BenchmarkGroup<WallTime>) {
  function bench_contention (line 145) | fn bench_contention(c: &mut Criterion) {
  function bench_uncontented (line 152) | fn bench_uncontented(c: &mut Criterion) {

FILE: benches/sync_semaphore.rs
  function single_rt (line 8) | fn single_rt() -> Runtime {
  function multi_rt (line 14) | fn multi_rt() -> Runtime {
  function uncontended (line 21) | fn uncontended(g: &mut BenchmarkGroup<WallTime>) {
  function task (line 38) | async fn task(s: Arc<Semaphore>) {
  function uncontended_concurrent_multi (line 43) | fn uncontended_concurrent_multi(g: &mut BenchmarkGroup<WallTime>) {
  function uncontended_concurrent_single (line 65) | fn uncontended_concurrent_single(g: &mut BenchmarkGroup<WallTime>) {
  function contended_concurrent_multi (line 86) | fn contended_concurrent_multi(g: &mut BenchmarkGroup<WallTime>) {
  function contended_concurrent_single (line 108) | fn contended_concurrent_single(g: &mut BenchmarkGroup<WallTime>) {
  function bench_contention (line 129) | fn bench_contention(c: &mut Criterion) {
  function bench_uncontented (line 136) | fn bench_uncontented(c: &mut Criterion) {

FILE: benches/sync_watch.rs
  function rt (line 9) | fn rt() -> tokio::runtime::Runtime {
  function do_work (line 16) | fn do_work(rng: &mut impl RngCore) -> u32 {
  function contention_resubscribe (line 29) | fn contention_resubscribe<const N_TASKS: usize>(g: &mut BenchmarkGroup<W...
  function bench_contention_resubscribe (line 74) | fn bench_contention_resubscribe(c: &mut Criterion) {

FILE: benches/time_now.rs
  function time_now_current_thread (line 7) | fn time_now_current_thread(c: &mut Criterion) {

FILE: benches/time_timeout.rs
  function quick_job (line 10) | async fn quick_job() -> usize {
  function build_run_time (line 14) | fn build_run_time(workers: usize) -> Runtime {
  function single_thread_scheduler_timeout (line 29) | fn single_thread_scheduler_timeout(c: &mut Criterion) {
  function multi_thread_scheduler_timeout (line 33) | fn multi_thread_scheduler_timeout(c: &mut Criterion) {
  function do_timeout_test (line 37) | fn do_timeout_test(c: &mut Criterion, workers: usize, name: &str) {
  function spawn_timeout_job (line 50) | async fn spawn_timeout_job(iters: usize, procs: usize) {
  function single_thread_scheduler_sleep (line 65) | fn single_thread_scheduler_sleep(c: &mut Criterion) {
  function multi_thread_scheduler_sleep (line 69) | fn multi_thread_scheduler_sleep(c: &mut Criterion) {
  function do_sleep_test (line 73) | fn do_sleep_test(c: &mut Criterion, workers: usize, name: &str) {
  function spawn_sleep_job (line 87) | async fn spawn_sleep_job(iters: usize, procs: usize) {

FILE: examples/chat.rs
  constant DEFAULT_ADDR (line 42) | const DEFAULT_ADDR: &str = "127.0.0.1:6142";
  function main (line 45) | async fn main() -> Result<(), Box<dyn Error>> {
  type Tx (line 102) | type Tx = mpsc::UnboundedSender<String>;
  type Rx (line 105) | type Rx = mpsc::UnboundedReceiver<String>;
  type Shared (line 113) | struct Shared {
    method new (line 135) | fn new() -> Self {
    method broadcast (line 145) | async fn broadcast(&mut self, sender: SocketAddr, message: &str) {
  type Peer (line 118) | struct Peer {
    method new (line 166) | async fn new(
  function process (line 184) | async fn process(

FILE: examples/connect-tcp.rs
  function main (line 29) | async fn main() -> Result<(), Box<dyn Error>> {
  function connect (line 46) | pub async fn connect(

FILE: examples/connect-udp.rs
  function main (line 29) | async fn main() -> Result<(), Box<dyn Error>> {
  function connect (line 46) | pub async fn connect(
  function send (line 70) | async fn send(
  function recv (line 82) | async fn recv(

FILE: examples/custom-executor-tokio-context.rs
  function main (line 11) | fn main() {

FILE: examples/custom-executor.rs
  function main (line 10) | fn main() {
  function spawn (line 29) | pub fn spawn(f: impl Future<Output = ()> + Send + 'static) {
  type ThreadPool (line 33) | struct ThreadPool {
    method spawn (line 51) | fn spawn(&self, f: impl Future<Output = ()> + Send + 'static) {

FILE: examples/dump.rs
  function main (line 11) | async fn main() -> Result<(), Box<dyn std::error::Error>> {
  function main (line 87) | fn main() {

FILE: examples/echo-tcp.rs
  constant DEFAULT_ADDR (line 30) | const DEFAULT_ADDR: &str = "127.0.0.1:8080";
  constant BUFFER_SIZE (line 31) | const BUFFER_SIZE: usize = 4096;
  function main (line 34) | async fn main() -> Result<(), Box<dyn Error>> {

FILE: examples/echo-udp.rs
  type Server (line 20) | struct Server {
    method run (line 27) | async fn run(self) -> Result<(), io::Error> {
  function main (line 52) | async fn main() -> Result<(), Box<dyn Error>> {

FILE: examples/hello_world.rs
  function main (line 20) | pub async fn main() -> Result<(), Box<dyn Error>> {

FILE: examples/named-pipe-multi-client.rs
  function windows_main (line 4) | async fn windows_main() -> io::Result<()> {
  function main (line 86) | async fn main() -> io::Result<()> {

FILE: examples/named-pipe-ready.rs
  function windows_main (line 4) | async fn windows_main() -> io::Result<()> {
  function main (line 149) | async fn main() -> io::Result<()> {

FILE: examples/named-pipe.rs
  function windows_main (line 4) | async fn windows_main() -> io::Result<()> {
  function main (line 48) | async fn main() -> io::Result<()> {

FILE: examples/print_each_packet.rs
  function main (line 64) | async fn main() -> Result<(), Box<dyn std::error::Error>> {

FILE: examples/proxy.rs
  function main (line 33) | async fn main() -> Result<(), Box<dyn Error>> {

FILE: examples/tinydb.rs
  type Database (line 58) | struct Database {
  type Request (line 63) | enum Request {
    method parse (line 180) | fn parse(input: &str) -> Result<Request, String> {
  type Response (line 69) | enum Response {
    method serialize (line 213) | fn serialize(&self) -> String {
  function main (line 85) | async fn main() -> Result<(), Box<dyn Error>> {
  function handle_request (line 151) | fn handle_request(line: &str, db: &Arc<Database>) -> Response {

FILE: examples/tinyhttp.rs
  function main (line 27) | async fn main() -> Result<(), Box<dyn Error>> {
  function process (line 46) | async fn process(stream: TcpStream) -> Result<(), Box<dyn Error>> {
  function respond (line 62) | async fn respond(req: Request<()>) -> Result<Response<String>, Box<dyn E...
  type Http (line 90) | struct Http;
    type Error (line 95) | type Error = io::Error;
    method encode (line 97) | fn encode(&mut self, item: Response<String>, dst: &mut BytesMut) -> io...
  type Item (line 149) | type Item = Request<()>;
  type Error (line 150) | type Error = io::Error;
  method decode (line 152) | fn decode(&mut self, src: &mut BytesMut) -> io::Result<Option<Request<()...
  type Now (line 223) | pub struct Now(());
    method fmt (line 261) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function now (line 227) | pub fn now() -> Now {
  type LastRenderedNow (line 248) | struct LastRenderedNow {
    method buffer (line 278) | fn buffer(&self) -> &str {
    method update (line 282) | fn update(&mut self, now: SystemTime, now_unix: u64) {
  type LocalBuffer (line 289) | struct LocalBuffer<'a>(&'a mut LastRenderedNow);
  function write_str (line 292) | fn write_str(&mut self, s: &str) -> fmt::Result {

FILE: examples/udp-client.rs
  function get_stdin_data (line 37) | fn get_stdin_data() -> Result<Vec<u8>, Box<dyn std::error::Error>> {
  function main (line 44) | async fn main() -> Result<(), Box<dyn Error>> {

FILE: examples/udp-codec.rs
  function main (line 25) | async fn main() -> Result<(), Box<dyn Error>> {
  function ping (line 56) | async fn ping(socket: &mut UdpFramed<BytesCodec>, b_addr: SocketAddr) ->...
  function pong (line 70) | async fn pong(socket: &mut UdpFramed<BytesCodec>) -> Result<(), io::Erro...

FILE: stress-test/examples/simple_echo_tcp.rs
  constant TCP_ENDPOINT (line 11) | const TCP_ENDPOINT: &str = "127.0.0.1:8080";
  constant NUM_MSGS (line 12) | const NUM_MSGS: usize = 100;
  constant MSG_SIZE (line 13) | const MSG_SIZE: usize = 1024;
  function main (line 15) | fn main() {

FILE: tests-build/tests/fail/macros_core_no_default.rs
  function my_fn (line 4) | async fn my_fn() {}
  function main (line 6) | fn main() {}

FILE: tests-build/tests/fail/macros_dead_code.rs
  function f (line 6) | async fn f() {}
  function main (line 8) | fn main() {}

FILE: tests-build/tests/fail/macros_invalid_input.rs
  function main_is_not_async (line 6) | fn main_is_not_async() {}
  function main_attr_has_unknown_args (line 9) | async fn main_attr_has_unknown_args() {}
  function main_attr_has_path_args (line 12) | async fn main_attr_has_path_args() {}
  function test_is_not_async (line 15) | fn test_is_not_async() {}
  function test_attr_has_args (line 18) | async fn test_attr_has_args() {}
  function test_unexpected_attr (line 21) | async fn test_unexpected_attr() {}
  function test_flavor_not_string (line 24) | async fn test_flavor_not_string() {}
  function test_unknown_flavor (line 27) | async fn test_unknown_flavor() {}
  function test_multi_thread_with_start_paused (line 30) | async fn test_multi_thread_with_start_paused() {}
  function test_worker_threads_not_int (line 33) | async fn test_worker_threads_not_int() {}
  function test_worker_threads_and_current_thread (line 36) | async fn test_worker_threads_and_current_thread() {}
  function test_crate_not_path_int (line 39) | async fn test_crate_not_path_int() {}
  function test_crate_not_path_invalid (line 42) | async fn test_crate_not_path_invalid() {}
  function test_multi_thread_with_unhandled_panic (line 45) | async fn test_multi_thread_with_unhandled_panic() {}
  function test_has_second_test_attr (line 49) | async fn test_has_second_test_attr() {}
  function test_has_second_test_attr_v1 (line 53) | async fn test_has_second_test_attr_v1() {}
  function test_has_second_test_attr_rust_2015 (line 57) | async fn test_has_second_test_attr_rust_2015() {}
  function test_has_second_test_attr_rust_2018 (line 61) | async fn test_has_second_test_attr_rust_2018() {}
  function test_has_second_test_attr_rust_2021 (line 65) | async fn test_has_second_test_attr_rust_2021() {}
  function test_has_generated_second_test_attr (line 69) | async fn test_has_generated_second_test_attr() {}
  function main (line 71) | fn main() {}

FILE: tests-build/tests/fail/macros_join.rs
  function main (line 4) | async fn main() {

FILE: tests-build/tests/fail/macros_try_join.rs
  function main (line 4) | async fn main() {

FILE: tests-build/tests/fail/macros_type_mismatch.rs
  function missing_semicolon_or_return_type (line 4) | async fn missing_semicolon_or_return_type() {
  function missing_return_type (line 9) | async fn missing_return_type() {
  function extra_semicolon (line 14) | async fn extra_semicolon() -> Result<(), ()> {
  function question_mark_operator_with_invalid_option (line 39) | async fn question_mark_operator_with_invalid_option() -> Option<()> {
  function question_mark_operator_with_invalid_result (line 56) | async fn question_mark_operator_with_invalid_result() -> Result<(), ()> {
  function issue_4635 (line 64) | async fn issue_4635() {
  function main (line 69) | fn main() {}

FILE: tests-build/tests/macros.rs
  function compile_fail_full (line 3) | fn compile_fail_full() {

FILE: tests-build/tests/macros_clippy.rs
  function test_with_semicolon_without_return_type (line 3) | async fn test_with_semicolon_without_return_type() {

FILE: tests-build/tests/pass/forward_args_and_output.rs
  function main (line 3) | fn main() {}
  function test_fn_has_args (line 8) | async fn test_fn_has_args(_x: u8) {}
  function test_has_output (line 11) | async fn test_has_output() -> Result<(), Box<dyn std::error::Error>> {

FILE: tests-build/tests/pass/impl_trait.rs
  function never (line 4) | async fn never() -> ! {
  function impl_trait (line 9) | async fn impl_trait() -> impl Iterator<Item = impl core::fmt::Debug> {
  function impl_trait2 (line 14) | async fn impl_trait2() -> Result<(), impl core::fmt::Debug> {
  function main (line 18) | fn main() {

FILE: tests-build/tests/pass/macros_main_loop.rs
  function main (line 4) | async fn main() -> Result<(), ()> {
  function never (line 12) | fn never() -> bool {

FILE: tests-build/tests/pass/macros_main_return.rs
  function main (line 4) | async fn main() -> Result<(), ()> {

FILE: tests-build/tests/pass/use_builder_outer.rs
  function main (line 7) | async fn main() {

FILE: tests-integration/src/bin/test-cat.rs
  function main (line 7) | fn main() {

FILE: tests-integration/src/bin/test-mem.rs
  function main (line 3) | fn main() {

FILE: tests-integration/src/bin/test-process-signal.rs
  function main (line 2) | fn main() {

FILE: tests-integration/tests/macros_main.rs
  function basic_main (line 4) | async fn basic_main() -> usize {
  function generic_fun (line 9) | async fn generic_fun<T: Default>() -> T {
  function spawning (line 14) | async fn spawning() -> usize {
  function local_main (line 21) | async fn local_main() -> usize {
  function main_with_spawn (line 27) | fn main_with_spawn() {
  function shell (line 32) | fn shell() {

FILE: tests-integration/tests/macros_pin.rs
  function my_async_fn (line 3) | async fn my_async_fn() {}
  function pin (line 6) | fn pin() {

FILE: tests-integration/tests/macros_select.rs
  function join_with_select (line 12) | fn join_with_select() {

FILE: tests-integration/tests/process_stdio.rs
  function cat (line 15) | fn cat() -> Command {
  function feed_cat (line 21) | async fn feed_cat(mut cat: Child, n: usize) -> io::Result<ExitStatus> {
  function feed_a_lot (line 85) | async fn feed_a_lot() {
  function wait_with_output_captures (line 92) | async fn wait_with_output_captures() {
  function status_closes_any_pipes (line 113) | async fn status_closes_any_pipes() {
  function try_wait (line 123) | async fn try_wait() {
  function pipe_from_one_command_to_another (line 146) | async fn pipe_from_one_command_to_another() {
  function vectored_writes (line 195) | async fn vectored_writes() {

FILE: tests-integration/tests/rt_yield.rs
  function spawn_send (line 4) | async fn spawn_send() {
  function entry_point (line 20) | async fn entry_point() {
  function test_macro (line 25) | async fn test_macro() {
  function main_macro (line 30) | fn main_macro() {
  function manual_rt (line 35) | fn manual_rt() {

FILE: tokio-macros/src/entry.rs
  type AttributeArgs (line 7) | type AttributeArgs = syn::punctuated::Punctuated<syn::Meta, syn::Token![...
  type RuntimeFlavor (line 10) | enum RuntimeFlavor {
    method from_str (line 17) | fn from_str(s: &str) -> Result<RuntimeFlavor, String> {
  type UnhandledPanic (line 31) | enum UnhandledPanic {
    method from_str (line 37) | fn from_str(s: &str) -> Result<UnhandledPanic, String> {
    method into_tokens (line 45) | fn into_tokens(self, crate_path: &TokenStream) -> TokenStream {
  type FinalConfig (line 55) | struct FinalConfig {
  constant DEFAULT_ERROR_CONFIG (line 64) | const DEFAULT_ERROR_CONFIG: FinalConfig = FinalConfig {
  type Configuration (line 72) | struct Configuration {
    method new (line 84) | fn new(is_test: bool, rt_multi_thread: bool) -> Self {
    method set_flavor (line 100) | fn set_flavor(&mut self, runtime: syn::Lit, span: Span) -> Result<(), ...
    method set_worker_threads (line 112) | fn set_worker_threads(
    method set_start_paused (line 132) | fn set_start_paused(&mut self, start_paused: syn::Lit, span: Span) -> ...
    method set_crate_name (line 142) | fn set_crate_name(&mut self, name: syn::Lit, span: Span) -> Result<(),...
    method set_unhandled_panic (line 151) | fn set_unhandled_panic(
    method macro_name (line 170) | fn macro_name(&self) -> &'static str {
    method build (line 178) | fn build(&self) -> Result<FinalConfig, syn::Error> {
  function parse_int (line 239) | fn parse_int(int: syn::Lit, span: Span, field: &str) -> Result<usize, sy...
  function parse_string (line 255) | fn parse_string(int: syn::Lit, span: Span, field: &str) -> Result<String...
  function parse_path (line 266) | fn parse_path(lit: syn::Lit, span: Span, field: &str) -> Result<Path, sy...
  function parse_bool (line 286) | fn parse_bool(bool: syn::Lit, span: Span, field: &str) -> Result<bool, s...
  function contains_impl_trait (line 296) | fn contains_impl_trait(ty: &syn::Type) -> bool {
  function build_config (line 325) | fn build_config(
  function parse_knobs (line 421) | fn parse_knobs(mut input: ItemFn, is_test: bool, config: FinalConfig) ->...
  function token_stream_with_error (line 577) | fn token_stream_with_error(mut tokens: TokenStream, error: syn::Error) -...
  function main (line 582) | pub(crate) fn main(args: TokenStream, item: TokenStream, rt_multi_thread...
  function is_test_attribute (line 610) | fn is_test_attribute(attr: &Attribute) -> bool {
  function test (line 635) | pub(crate) fn test(args: TokenStream, item: TokenStream, rt_multi_thread...
  type ItemFn (line 658) | struct ItemFn {
    method attrs (line 669) | fn attrs(&self) -> impl Iterator<Item = &Attribute> {
    method body (line 675) | fn body(&self) -> Body<'_> {
    method into_tokens (line 683) | fn into_tokens(
  method parse (line 720) | fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
  type Body (line 767) | struct Body<'a> {
  method to_tokens (line 774) | fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) {

FILE: tokio-macros/src/lib.rs
  function main (line 301) | pub fn main(args: TokenStream, item: TokenStream) -> TokenStream {
  function main_rt (line 365) | pub fn main_rt(args: TokenStream, item: TokenStream) -> TokenStream {
  function test (line 569) | pub fn test(args: TokenStream, item: TokenStream) -> TokenStream {
  function test_rt (line 584) | pub fn test_rt(args: TokenStream, item: TokenStream) -> TokenStream {
  function main_fail (line 593) | pub fn main_fail(_args: TokenStream, _item: TokenStream) -> TokenStream {
  function test_fail (line 607) | pub fn test_fail(_args: TokenStream, _item: TokenStream) -> TokenStream {
  function select_priv_declare_output_enum (line 620) | pub fn select_priv_declare_output_enum(input: TokenStream) -> TokenStream {
  function select_priv_clean_pattern (line 628) | pub fn select_priv_clean_pattern(input: TokenStream) -> TokenStream {

FILE: tokio-macros/src/select.rs
  function declare_output_enum (line 6) | pub(crate) fn declare_output_enum(input: TokenStream) -> TokenStream {
  function clean_pattern_macro (line 45) | pub(crate) fn clean_pattern_macro(input: TokenStream) -> TokenStream {
  function clean_pattern (line 59) | fn clean_pattern(pat: &mut syn::Pat) {

FILE: tokio-stream/fuzz/fuzz_targets/fuzz_stream_map.rs
  function pin_box (line 18) | fn pin_box<T: Stream<Item = U> + 'static, U>(s: T) -> Pin<Box<dyn Stream...

FILE: tokio-stream/src/empty.rs
  type Empty (line 10) | pub struct Empty<T>(PhantomData<T>);
  function empty (line 36) | pub const fn empty<T>() -> Empty<T> {
  type Item (line 41) | type Item = T;
  method poll_next (line 43) | fn poll_next(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Option<T...
  method size_hint (line 47) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/iter.rs
  type Iter (line 9) | pub struct Iter<I> {
  function iter (line 33) | pub fn iter<I>(i: I) -> Iter<I::IntoIter>
  type Item (line 47) | type Item = I::Item;
  method poll_next (line 49) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  method size_hint (line 64) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/once.rs
  type Once (line 10) | pub struct Once<T> {
  function once (line 36) | pub fn once<T>(value: T) -> Once<T> {
  type Item (line 43) | type Item = T;
  method poll_next (line 45) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  method size_hint (line 49) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/pending.rs
  type Pending (line 10) | pub struct Pending<T>(PhantomData<T>);
  function pending (line 40) | pub const fn pending<T>() -> Pending<T> {
  type Item (line 45) | type Item = T;
  method poll_next (line 47) | fn poll_next(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Option<T...
  method size_hint (line 51) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/stream_close.rs
  function new (line 44) | pub fn new(stream: S) -> Self {
  function into_inner (line 53) | pub fn into_inner(self) -> Option<S> {
  type Item (line 62) | type Item = Option<S::Item>;
  method poll_next (line 64) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  method size_hint (line 84) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/stream_ext.rs
  type StreamExt (line 106) | pub trait StreamExt: Stream {
    method next (line 144) | fn next(&mut self) -> Next<'_, Self>
    method try_next (line 186) | fn try_next<T, E>(&mut self) -> TryNext<'_, Self>
    method map (line 219) | fn map<T, F>(self, f: F) -> Map<Self, F>
    method map_while (line 261) | fn map_while<T, F>(self, f: F) -> MapWhile<Self, F>
    method then (line 305) | fn then<F, Fut>(self, f: F) -> Then<Self, Fut, F>
    method merge (line 398) | fn merge<U>(self, other: U) -> Merge<Self, U>
    method filter (line 436) | fn filter<F>(self, f: F) -> Filter<Self, F>
    method filter_map (line 474) | fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F>
    method fuse (line 543) | fn fuse(self) -> Fuse<Self>
    method take (line 570) | fn take(self, n: usize) -> Take<Self>
    method take_while (line 599) | fn take_while<F>(self, f: F) -> TakeWhile<Self, F>
    method skip (line 625) | fn skip(self, n: usize) -> Skip<Self>
    method skip_while (line 655) | fn skip_while<F>(self, f: F) -> SkipWhile<Self, F>
    method all (line 716) | fn all<F>(&mut self, f: F) -> AllFuture<'_, Self, F>
    method any (line 775) | fn any<F>(&mut self, f: F) -> AnyFuture<'_, Self, F>
    method chain (line 810) | fn chain<U>(self, other: U) -> Chain<Self, U>
    method fold (line 840) | fn fold<B, F>(self, init: B, f: F) -> FoldFuture<Self, B, F>
    method collect (line 919) | fn collect<T>(self) -> Collect<Self, T, T::InternalCollection>
    method timeout (line 1005) | fn timeout(self, duration: Duration) -> Timeout<Self>
    method timeout_repeating (line 1093) | fn timeout_repeating(self, interval: Interval) -> TimeoutRepeating<Self>
    method throttle (line 1123) | fn throttle(self, duration: Duration) -> Throttle<Self>
    method chunks_timeout (line 1179) | fn chunks_timeout(self, max_size: usize, duration: Duration) -> Chunks...
    method peekable (line 1205) | fn peekable(self) -> Peekable<Self>
  function merge_size_hints (line 1216) | fn merge_size_hints(

FILE: tokio-stream/src/stream_ext/all.rs
  function new (line 23) | pub(super) fn new(stream: &'a mut St, f: F) -> Self {
  type Output (line 37) | type Output = bool;
  method poll (line 39) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {

FILE: tokio-stream/src/stream_ext/any.rs
  function new (line 23) | pub(super) fn new(stream: &'a mut St, f: F) -> Self {
  type Output (line 37) | type Output = bool;
  method poll (line 39) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {

FILE: tokio-stream/src/stream_ext/chain.rs
  function new (line 19) | pub(super) fn new(a: T, b: U) -> Chain<T, U>
  type Item (line 33) | type Item = T::Item;
  method poll_next (line 35) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  method size_hint (line 47) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/stream_ext/chunks_timeout.rs
  function new (line 27) | pub(super) fn new(stream: S, max_size: usize, duration: Duration) -> Self {
  function into_remainder (line 38) | pub fn into_remainder(mut self: Pin<&mut Self>) -> Vec<S::Item> {
  type Item (line 45) | type Item = Vec<S::Item>;
  method poll_next (line 47) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  method size_hint (line 85) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/stream_ext/collect.rs
  type FromStream (line 39) | pub trait FromStream<T>: sealed::FromStreamPriv<T> {}
  function new (line 46) | pub(super) fn new(stream: T) -> Collect<T, U, U::InternalCollection> {
  type Output (line 64) | type Output = U;
  method poll (line 66) | fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<U> {
  type InternalCollection (line 91) | type InternalCollection = ();
  function initialize (line 93) | fn initialize(_: sealed::Internal, _lower: usize, _upper: Option<usize>) {}
  function extend (line 95) | fn extend(_: sealed::Internal, _collection: &mut (), _item: ()) -> bool {
  function finalize (line 99) | fn finalize(_: sealed::Internal, _collection: &mut ()) {}
  type InternalCollection (line 105) | type InternalCollection = String;
  method initialize (line 107) | fn initialize(_: sealed::Internal, _lower: usize, _upper: Option<usize>)...
  method extend (line 111) | fn extend(_: sealed::Internal, collection: &mut String, item: T) -> bool {
  method finalize (line 116) | fn finalize(_: sealed::Internal, collection: &mut String) -> String {
  type InternalCollection (line 124) | type InternalCollection = Vec<T>;
  function initialize (line 126) | fn initialize(_: sealed::Internal, lower: usize, _upper: Option<usize>) ...
  function extend (line 130) | fn extend(_: sealed::Internal, collection: &mut Vec<T>, item: T) -> bool {
  function finalize (line 135) | fn finalize(_: sealed::Internal, collection: &mut Vec<T>) -> Vec<T> {
  type InternalCollection (line 143) | type InternalCollection = VecDeque<T>;
  function initialize (line 145) | fn initialize(_: sealed::Internal, lower: usize, _upper: Option<usize>) ...
  function extend (line 149) | fn extend(_: sealed::Internal, collection: &mut VecDeque<T>, item: T) ->...
  function finalize (line 154) | fn finalize(_: sealed::Internal, collection: &mut VecDeque<T>) -> VecDeq...
  type InternalCollection (line 162) | type InternalCollection = LinkedList<T>;
  function initialize (line 164) | fn initialize(_: sealed::Internal, _lower: usize, _upper: Option<usize>)...
  function extend (line 168) | fn extend(_: sealed::Internal, collection: &mut LinkedList<T>, item: T) ...
  function finalize (line 173) | fn finalize(_: sealed::Internal, collection: &mut LinkedList<T>) -> Link...
  type InternalCollection (line 181) | type InternalCollection = BTreeSet<T>;
  function initialize (line 183) | fn initialize(_: sealed::Internal, _lower: usize, _upper: Option<usize>)...
  function extend (line 187) | fn extend(_: sealed::Internal, collection: &mut BTreeSet<T>, item: T) ->...
  function finalize (line 192) | fn finalize(_: sealed::Internal, collection: &mut BTreeSet<T>) -> BTreeS...
  type InternalCollection (line 200) | type InternalCollection = BTreeMap<K, V>;
  function initialize (line 202) | fn initialize(_: sealed::Internal, _lower: usize, _upper: Option<usize>)...
  function extend (line 206) | fn extend(_: sealed::Internal, collection: &mut BTreeMap<K, V>, (key, va...
  function finalize (line 211) | fn finalize(_: sealed::Internal, collection: &mut BTreeMap<K, V>) -> BTr...
  type InternalCollection (line 219) | type InternalCollection = HashSet<T>;
  function initialize (line 221) | fn initialize(_: sealed::Internal, lower: usize, _upper: Option<usize>) ...
  function extend (line 225) | fn extend(_: sealed::Internal, collection: &mut HashSet<T>, item: T) -> ...
  function finalize (line 230) | fn finalize(_: sealed::Internal, collection: &mut HashSet<T>) -> HashSet...
  type InternalCollection (line 238) | type InternalCollection = HashMap<K, V>;
  function initialize (line 240) | fn initialize(_: sealed::Internal, lower: usize, _upper: Option<usize>) ...
  function extend (line 244) | fn extend(_: sealed::Internal, collection: &mut HashMap<K, V>, (key, val...
  function finalize (line 249) | fn finalize(_: sealed::Internal, collection: &mut HashMap<K, V>) -> Hash...
  type InternalCollection (line 257) | type InternalCollection = BinaryHeap<T>;
  function initialize (line 259) | fn initialize(_: sealed::Internal, lower: usize, _upper: Option<usize>) ...
  function extend (line 263) | fn extend(_: sealed::Internal, collection: &mut BinaryHeap<T>, item: T) ...
  function finalize (line 268) | fn finalize(_: sealed::Internal, collection: &mut BinaryHeap<T>) -> Bina...
  type InternalCollection (line 276) | type InternalCollection = Vec<T>;
  function initialize (line 278) | fn initialize(_: sealed::Internal, lower: usize, upper: Option<usize>) -...
  function extend (line 282) | fn extend(_: sealed::Internal, collection: &mut Vec<T>, item: T) -> bool {
  function finalize (line 286) | fn finalize(_: sealed::Internal, collection: &mut Vec<T>) -> Box<[T]> {
  type InternalCollection (line 298) | type InternalCollection = Result<U::InternalCollection, E>;
  function initialize (line 300) | fn initialize(
  function extend (line 308) | fn extend(
  function finalize (line 326) | fn finalize(_: sealed::Internal, collection: &mut Self::InternalCollecti...
  type FromStreamPriv (line 339) | pub trait FromStreamPriv<T> {
    method initialize (line 346) | fn initialize(
    method extend (line 355) | fn extend(internal: Internal, collection: &mut Self::InternalCollectio...
    method finalize (line 358) | fn finalize(internal: Internal, collection: &mut Self::InternalCollect...
  type Internal (line 362) | pub struct Internal;

FILE: tokio-stream/src/stream_ext/filter.rs
  function fmt (line 22) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function new (line 30) | pub(super) fn new(stream: St, f: F) -> Self {
  type Item (line 40) | type Item = St::Item;
  method poll_next (line 42) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  method size_hint (line 55) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/stream_ext/filter_map.rs
  function fmt (line 22) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function new (line 30) | pub(super) fn new(stream: St, f: F) -> Self {
  type Item (line 40) | type Item = T;
  method poll_next (line 42) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  method size_hint (line 55) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/stream_ext/fold.rs
  function new (line 25) | pub(super) fn new(stream: St, init: B, f: F) -> Self {
  type Output (line 40) | type Output = B;
  method poll (line 42) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {

FILE: tokio-stream/src/stream_ext/fuse.rs
  function new (line 20) | pub(crate) fn new(stream: T) -> Fuse<T> {
  type Item (line 31) | type Item = T::Item;
  method poll_next (line 33) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  method size_hint (line 47) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/stream_ext/map.rs
  function fmt (line 22) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function new (line 28) | pub(super) fn new(stream: St, f: F) -> Self {
  type Item (line 38) | type Item = T;
  method poll_next (line 40) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  method size_hint (line 48) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/stream_ext/map_while.rs
  function fmt (line 22) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function new (line 30) | pub(super) fn new(stream: St, f: F) -> Self {
  type Item (line 40) | type Item = T;
  method poll_next (line 42) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  method size_hint (line 48) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/stream_ext/merge.rs
  function new (line 21) | pub(super) fn new(a: T, b: U) -> Merge<T, U>
  type Item (line 39) | type Item = T::Item;
  method poll_next (line 41) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  method size_hint (line 55) | fn size_hint(&self) -> (usize, Option<usize>) {
  function poll_next (line 60) | fn poll_next<T, U>(

FILE: tokio-stream/src/stream_ext/next.rs
  function new (line 29) | pub(super) fn new(stream: &'a mut St) -> Self {
  type Output (line 38) | type Output = Option<St::Item>;
  method poll (line 40) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {

FILE: tokio-stream/src/stream_ext/peekable.rs
  function new (line 20) | pub(crate) fn new(stream: T) -> Self {
  function peek (line 26) | pub async fn peek(&mut self) -> Option<&T::Item>
  type Item (line 40) | type Item = T::Item;
  method poll_next (line 42) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...

FILE: tokio-stream/src/stream_ext/skip.rs
  function fmt (line 22) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function new (line 30) | pub(super) fn new(stream: St, remaining: usize) -> Self {
  type Item (line 39) | type Item = St::Item;
  method poll_next (line 41) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  method size_hint (line 55) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/stream_ext/skip_while.rs
  function fmt (line 22) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function new (line 30) | pub(super) fn new(stream: St, predicate: F) -> Self {
  type Item (line 43) | type Item = St::Item;
  method poll_next (line 45) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  method size_hint (line 64) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/stream_ext/take.rs
  function fmt (line 23) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function new (line 31) | pub(super) fn new(stream: St, remaining: usize) -> Self {
  type Item (line 40) | type Item = St::Item;
  method poll_next (line 42) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  method size_hint (line 60) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/stream_ext/take_while.rs
  function fmt (line 23) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function new (line 32) | pub(super) fn new(stream: St, predicate: F) -> Self {
  type Item (line 46) | type Item = St::Item;
  method poll_next (line 48) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  method size_hint (line 70) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/stream_ext/then.rs
  function fmt (line 25) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function new (line 33) | pub(super) fn new(stream: St, f: F) -> Self {
  type Item (line 48) | type Item = Fut::Output;
  method poll_next (line 50) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  method size_hint (line 74) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/stream_ext/throttle.rs
  function throttle (line 12) | pub(super) fn throttle<T>(duration: Duration, stream: T) -> Throttle<T>
  function get_ref (line 46) | pub fn get_ref(&self) -> &T {
  function get_mut (line 55) | pub fn get_mut(&mut self) -> &mut T {
  function into_inner (line 63) | pub fn into_inner(self) -> T {
  type Item (line 69) | type Item = T::Item;
  method poll_next (line 71) | fn poll_next(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll<O...
  function is_zero (line 94) | fn is_zero(dur: Duration) -> bool {

FILE: tokio-stream/src/stream_ext/timeout.rs
  type Elapsed (line 28) | pub struct Elapsed(());
    method new (line 90) | pub(crate) fn new() -> Self {
    method fmt (line 96) | fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
  function new (line 31) | pub(super) fn new(stream: S, duration: Duration) -> Self {
  type Item (line 45) | type Item = Result<S::Item, Elapsed>;
  method poll_next (line 47) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  method size_hint (line 71) | fn size_hint(&self) -> (usize, Option<usize>) {
  function from (line 104) | fn from(_err: Elapsed) -> std::io::Error {

FILE: tokio-stream/src/stream_ext/timeout_repeating.rs
  function new (line 22) | pub(super) fn new(stream: S, interval: Interval) -> Self {
  type Item (line 31) | type Item = Result<S::Item, Elapsed>;
  method poll_next (line 33) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  method size_hint (line 50) | fn size_hint(&self) -> (usize, Option<usize>) {

FILE: tokio-stream/src/stream_ext/try_next.rs
  function new (line 30) | pub(super) fn new(stream: &'a mut St) -> Self {
  type Output (line 39) | type Output = Result<Option<T>, E>;
  method poll (line 41) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {

FILE: tokio-stream/src/stream_map.rs
  type StreamMap (line 205) | pub struct StreamMap<K, V> {
  function iter (line 230) | pub fn iter(&self) -> impl Iterator<Item = &(K, V)> {
  function iter_mut (line 253) | pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut (K, V)> {
  function new (line 269) | pub fn new() -> StreamMap<K, V> {
  function with_capacity (line 285) | pub fn with_capacity(capacity: usize) -> StreamMap<K, V> {
  function keys (line 310) | pub fn keys(&self) -> impl Iterator<Item = &K> {
  function values (line 333) | pub fn values(&self) -> impl Iterator<Item = &V> {
  function values_mut (line 356) | pub fn values_mut(&mut self) -> impl Iterator<Item = &mut V> {
  function capacity (line 373) | pub fn capacity(&self) -> usize {
  function len (line 389) | pub fn len(&self) -> usize {
  function is_empty (line 405) | pub fn is_empty(&self) -> bool {
  function clear (line 422) | pub fn clear(&mut self) {
  function insert (line 446) | pub fn insert(&mut self, k: K, stream: V) -> Option<V>
  function remove (line 471) | pub fn remove<Q>(&mut self, k: &Q) -> Option<V>
  function contains_key (line 500) | pub fn contains_key<Q>(&self, k: &Q) -> bool
  function poll_next_entry (line 521) | fn poll_next_entry(&mut self, cx: &mut Context<'_>) -> Poll<Option<(usiz...
  method default (line 560) | fn default() -> Self {
  function next_many (line 587) | pub async fn next_many(&mut self, buffer: &mut Vec<(K, V::Item)>, limit:...
  function poll_next_many (line 603) | pub fn poll_next_many(
  type Item (line 676) | type Item = (K, V::Item);
  method poll_next (line 678) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  method size_hint (line 687) | fn size_hint(&self) -> (usize, Option<usize>) {
  function from_iter (line 710) | fn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> Self {
  function extend (line 724) | fn extend<T>(&mut self, iter: T)
  function seed (line 745) | pub(crate) fn seed() -> u64 {
  function seed (line 753) | pub(crate) fn seed() -> u64 {
  type FastRand (line 767) | pub(crate) struct FastRand {
    method new (line 774) | pub(crate) fn new(seed: u64) -> FastRand {
    method fastrand_n (line 789) | pub(crate) fn fastrand_n(&self, n: u32) -> u32 {
    method fastrand (line 796) | fn fastrand(&self) -> u32 {
  function thread_rng_n (line 811) | pub(crate) fn thread_rng_n(n: u32) -> u32 {

FILE: tokio-stream/src/wrappers/broadcast.rs
  type BroadcastStream (line 39) | pub struct BroadcastStream<T> {
  type BroadcastStreamRecvError (line 45) | pub enum BroadcastStreamRecvError {
    method fmt (line 54) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function make_future (line 63) | async fn make_future<T: Clone>(mut rx: Receiver<T>) -> (Result<T, RecvEr...
  function new (line 70) | pub fn new(rx: Receiver<T>) -> Self {
  type Item (line 78) | type Item = Result<T, BroadcastStreamRecvError>;
  method poll_next (line 79) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  function fmt (line 93) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function from (line 99) | fn from(recv: Receiver<T>) -> Self {

FILE: tokio-stream/src/wrappers/interval.rs
  type IntervalStream (line 33) | pub struct IntervalStream {
    method new (line 39) | pub fn new(interval: Interval) -> Self {
    method into_inner (line 44) | pub fn into_inner(self) -> Interval {
    method as_ref (line 68) | fn as_ref(&self) -> &Interval {
    method as_mut (line 74) | fn as_mut(&mut self) -> &mut Interval {
  type Item (line 50) | type Item = Instant;
  method poll_next (line 52) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  method size_hint (line 56) | fn size_hint(&self) -> (usize, Option<usize>) {
  method is_terminated (line 62) | fn is_terminated(&self) -> bool {

FILE: tokio-stream/src/wrappers/lines.rs
  function new (line 41) | pub fn new(lines: Lines<R>) -> Self {
  function into_inner (line 46) | pub fn into_inner(self) -> Lines<R> {
  function as_pin_mut (line 51) | pub fn as_pin_mut(self: Pin<&mut Self>) -> Pin<&mut Lines<R>> {
  type Item (line 57) | type Item = io::Result<String>;
  method poll_next (line 59) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  function as_ref (line 68) | fn as_ref(&self) -> &Lines<R> {
  function as_mut (line 74) | fn as_mut(&mut self) -> &mut Lines<R> {

FILE: tokio-stream/src/wrappers/mpsc_bounded.rs
  type ReceiverStream (line 34) | pub struct ReceiverStream<T> {
  function new (line 40) | pub fn new(recv: Receiver<T>) -> Self {
  function into_inner (line 45) | pub fn into_inner(self) -> Receiver<T> {
  function close (line 59) | pub fn close(&mut self) {
  type Item (line 65) | type Item = T;
  method poll_next (line 67) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  method size_hint (line 81) | fn size_hint(&self) -> (usize, Option<usize>) {
  function as_ref (line 92) | fn as_ref(&self) -> &Receiver<T> {
  function as_mut (line 98) | fn as_mut(&mut self) -> &mut Receiver<T> {
  function from (line 104) | fn from(recv: Receiver<T>) -> Self {

FILE: tokio-stream/src/wrappers/mpsc_unbounded.rs
  type UnboundedReceiverStream (line 34) | pub struct UnboundedReceiverStream<T> {
  function new (line 40) | pub fn new(recv: UnboundedReceiver<T>) -> Self {
  function into_inner (line 45) | pub fn into_inner(self) -> UnboundedReceiver<T> {
  function close (line 53) | pub fn close(&mut self) {
  type Item (line 59) | type Item = T;
  method poll_next (line 61) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  method size_hint (line 70) | fn size_hint(&self) -> (usize, Option<usize>) {
  function as_ref (line 81) | fn as_ref(&self) -> &UnboundedReceiver<T> {
  function as_mut (line 87) | fn as_mut(&mut self) -> &mut UnboundedReceiver<T> {
  function from (line 93) | fn from(recv: UnboundedReceiver<T>) -> Self {

FILE: tokio-stream/src/wrappers/read_dir.rs
  type ReadDirStream (line 31) | pub struct ReadDirStream {
    method new (line 37) | pub fn new(read_dir: ReadDir) -> Self {
    method into_inner (line 42) | pub fn into_inner(self) -> ReadDir {
    method as_ref (line 56) | fn as_ref(&self) -> &ReadDir {
    method as_mut (line 62) | fn as_mut(&mut self) -> &mut ReadDir {
  type Item (line 48) | type Item = io::Result<DirEntry>;
  method poll_next (line 50) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...

FILE: tokio-stream/src/wrappers/signal_unix.rs
  type SignalStream (line 28) | pub struct SignalStream {
    method new (line 34) | pub fn new(signal: Signal) -> Self {
    method into_inner (line 39) | pub fn into_inner(self) -> Signal {
    method as_ref (line 53) | fn as_ref(&self) -> &Signal {
    method as_mut (line 59) | fn as_mut(&mut self) -> &mut Signal {
  type Item (line 45) | type Item = ();
  method poll_next (line 47) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...

FILE: tokio-stream/src/wrappers/signal_windows.rs
  type CtrlCStream (line 29) | pub struct CtrlCStream {
    method new (line 35) | pub fn new(interval: CtrlC) -> Self {
    method into_inner (line 40) | pub fn into_inner(self) -> CtrlC {
    method as_ref (line 54) | fn as_ref(&self) -> &CtrlC {
    method as_mut (line 60) | fn as_mut(&mut self) -> &mut CtrlC {
  type Item (line 46) | type Item = ();
  method poll_next (line 48) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  type CtrlBreakStream (line 88) | pub struct CtrlBreakStream {
    method new (line 94) | pub fn new(interval: CtrlBreak) -> Self {
    method into_inner (line 99) | pub fn into_inner(self) -> CtrlBreak {
    method as_ref (line 113) | fn as_ref(&self) -> &CtrlBreak {
    method as_mut (line 119) | fn as_mut(&mut self) -> &mut CtrlBreak {
  type Item (line 105) | type Item = ();
  method poll_next (line 107) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...

FILE: tokio-stream/src/wrappers/split.rs
  function new (line 41) | pub fn new(split: Split<R>) -> Self {
  function into_inner (line 46) | pub fn into_inner(self) -> Split<R> {
  function as_pin_mut (line 51) | pub fn as_pin_mut(self: Pin<&mut Self>) -> Pin<&mut Split<R>> {
  type Item (line 57) | type Item = io::Result<Vec<u8>>;
  method poll_next (line 59) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  function as_ref (line 68) | fn as_ref(&self) -> &Split<R> {
  function as_mut (line 74) | fn as_mut(&mut self) -> &mut Split<R> {

FILE: tokio-stream/src/wrappers/tcp_listener.rs
  type TcpListenerStream (line 43) | pub struct TcpListenerStream {
    method new (line 49) | pub fn new(listener: TcpListener) -> Self {
    method into_inner (line 54) | pub fn into_inner(self) -> TcpListener {
    method as_ref (line 75) | fn as_ref(&self) -> &TcpListener {
    method as_mut (line 81) | fn as_mut(&mut self) -> &mut TcpListener {
  type Item (line 60) | type Item = io::Result<TcpStream>;
  method poll_next (line 62) | fn poll_next(

FILE: tokio-stream/src/wrappers/unix_listener.rs
  type UnixListenerStream (line 32) | pub struct UnixListenerStream {
    method new (line 38) | pub fn new(listener: UnixListener) -> Self {
    method into_inner (line 43) | pub fn into_inner(self) -> UnixListener {
    method as_ref (line 64) | fn as_ref(&self) -> &UnixListener {
    method as_mut (line 70) | fn as_mut(&mut self) -> &mut UnixListener {
  type Item (line 49) | type Item = io::Result<UnixStream>;
  method poll_next (line 51) | fn poll_next(

FILE: tokio-stream/src/wrappers/watch.rs
  type WatchStream (line 74) | pub struct WatchStream<T> {
  function make_future (line 78) | async fn make_future<T: Clone + Send + Sync>(
  function new (line 87) | pub fn new(rx: Receiver<T>) -> Self {
  function from_changes (line 94) | pub fn from_changes(rx: Receiver<T>) -> Self {
  type Item (line 102) | type Item = T;
  method poll_next (line 104) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  function fmt (line 123) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function from (line 129) | fn from(recv: Receiver<T>) -> Self {

FILE: tokio-stream/tests/async_send_sync.rs
  type BoxStream (line 6) | type BoxStream<T> = std::pin::Pin<Box<dyn tokio_stream::Stream<Item = T>>>;
  function require_send (line 9) | fn require_send<T: Send>(_t: &T) {}
  function require_sync (line 11) | fn require_sync<T: Sync>(_t: &T) {}
  function require_unpin (line 13) | fn require_unpin<T: Unpin>(_t: &T) {}
  type Invalid (line 16) | struct Invalid;
  type AmbiguousIfSend (line 19) | trait AmbiguousIfSend<A> {
    method some_item (line 20) | fn some_item(&self) {}
  type AmbiguousIfSync (line 26) | trait AmbiguousIfSync<A> {
    method some_item (line 27) | fn some_item(&self) {}
  type AmbiguousIfUnpin (line 33) | trait AmbiguousIfUnpin<A> {
    method some_item (line 34) | fn some_item(&self) {}

FILE: tokio-stream/tests/chunks_timeout.rs
  function usage (line 13) | async fn usage() {
  function full_chunk_with_timeout (line 37) | async fn full_chunk_with_timeout() {
  function real_time (line 67) | async fn real_time() {

FILE: tokio-stream/tests/mpsc_bounded_stream.rs
  function size_hint_stream_open (line 6) | async fn size_hint_stream_open() {
  function size_hint_stream_closed (line 22) | async fn size_hint_stream_closed() {
  function size_hint_sender_dropped (line 39) | async fn size_hint_sender_dropped() {
  function size_hint_stream_instantly_closed (line 56) | fn size_hint_stream_instantly_closed() {
  function size_hint_stream_closed_permits_send (line 66) | async fn size_hint_stream_closed_permits_send() {
  function size_hint_stream_closed_permits_drop (line 91) | async fn size_hint_stream_closed_permits_drop() {

FILE: tokio-stream/tests/mpsc_unbounded_stream.rs
  function size_hint_stream_open (line 6) | async fn size_hint_stream_open() {
  function size_hint_stream_closed (line 22) | async fn size_hint_stream_closed() {
  function size_hint_sender_dropped (line 39) | async fn size_hint_sender_dropped() {
  function size_hint_stream_instantly_closed (line 56) | fn size_hint_stream_instantly_closed() {

FILE: tokio-stream/tests/stream_chain.rs
  function basic_usage (line 12) | async fn basic_usage() {
  function visibility_test (line 43) | fn visibility_test<I, S1, S2>(s1: S1, s2: S2) -> Chain<S1, S2>
  function pending_first (line 53) | async fn pending_first() {
  function size_overflow (line 89) | fn size_overflow() {

FILE: tokio-stream/tests/stream_chunks_timeout.rs
  function stream_chunks_remainder (line 12) | async fn stream_chunks_remainder() -> Result<(), Box<dyn Error>> {

FILE: tokio-stream/tests/stream_close.rs
  function basic_usage (line 4) | async fn basic_usage() {

FILE: tokio-stream/tests/stream_collect.rs
  function empty_unit (line 14) | async fn empty_unit() {
  function empty_vec (line 22) | async fn empty_vec() {
  function empty_box_slice (line 28) | async fn empty_box_slice() {
  function empty_string (line 34) | async fn empty_string() {
  function empty_result (line 40) | async fn empty_result() {
  function collect_vec_items (line 46) | async fn collect_vec_items() {
  function collect_vecdeque_items (line 67) | async fn collect_vecdeque_items() {
  function collect_linkedlist_items (line 89) | async fn collect_linkedlist_items() {
  function collect_btreeset_items (line 111) | async fn collect_btreeset_items() {
  function collect_btreemap_items (line 132) | async fn collect_btreemap_items() {
  function collect_hashset_items (line 153) | async fn collect_hashset_items() {
  function collect_hashmap_items (line 174) | async fn collect_hashmap_items() {
  function collect_binaryheap_items (line 195) | async fn collect_binaryheap_items() {
  function collect_string_items (line 216) | async fn collect_string_items() {
  function collect_str_items (line 238) | async fn collect_str_items() {
  function collect_results_ok (line 260) | async fn collect_results_ok() {
  function collect_results_err (line 282) | async fn collect_results_err() {

FILE: tokio-stream/tests/stream_empty.rs
  function basic_usage (line 4) | async fn basic_usage() {

FILE: tokio-stream/tests/stream_fuse.rs
  type Alternate (line 7) | struct Alternate {
  type Item (line 12) | type Item = i32;
  method poll_next (line 14) | fn poll_next(mut self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Op...
  function basic_usage (line 28) | async fn basic_usage() {
  function interval_stream_is_never_terminated (line 54) | async fn interval_stream_is_never_terminated() {

FILE: tokio-stream/tests/stream_iter.rs
  function coop (line 7) | async fn coop() {

FILE: tokio-stream/tests/stream_merge.rs
  function merge_sync_streams (line 12) | async fn merge_sync_streams() {
  function merge_async_streams (line 25) | async fn merge_async_streams() {
  function size_overflow (line 62) | fn size_overflow() {

FILE: tokio-stream/tests/stream_once.rs
  function basic_usage (line 4) | async fn basic_usage() {

FILE: tokio-stream/tests/stream_panic.rs
  function test_panic (line 12) | fn test_panic<Func: FnOnce() + panic::UnwindSafe>(func: Func) -> Option<...
  function stream_chunks_timeout_panic_caller (line 44) | fn stream_chunks_timeout_panic_caller() -> Result<(), Box<dyn Error>> {

FILE: tokio-stream/tests/stream_pending.rs
  function basic_usage (line 5) | async fn basic_usage() {

FILE: tokio-stream/tests/stream_stream_map.rs
  function empty (line 34) | async fn empty() {
  function single_entry (line 47) | async fn single_entry() {
  function multiple_entries (line 86) | async fn multiple_entries() {
  function insert_remove (line 145) | async fn insert_remove() {
  function replace (line 175) | async fn replace() {
  function size_hint_with_upper (line 202) | fn size_hint_with_upper() {
  function size_hint_without_upper (line 217) | fn size_hint_without_upper() {
  function new_capacity_zero (line 229) | fn new_capacity_zero() {
  function with_capacity (line 237) | fn with_capacity() {
  function iter_keys (line 245) | fn iter_keys() {
  function iter_values (line 259) | fn iter_values() {
  function iter_values_mut (line 274) | fn iter_values_mut() {
  function clear (line 292) | fn clear() {
  function contains_key_borrow (line 308) | fn contains_key_borrow() {
  function one_ready_many_none (line 316) | fn one_ready_many_none() {
  function pin_box (line 331) | fn pin_box<T: Stream<Item = U> + 'static, U>(s: T) -> Pin<Box<dyn Stream...
  type UsizeStream (line 335) | type UsizeStream = Pin<Box<dyn Stream<Item = usize> + Send>>;
  function poll_next_many_zero (line 338) | async fn poll_next_many_zero() {
  function poll_next_many_empty (line 349) | async fn poll_next_many_empty() {
  function poll_next_many_pending (line 358) | async fn poll_next_many_pending() {
  function poll_next_many_not_enough (line 377) | async fn poll_next_many_not_enough() {
  function poll_next_many_enough (line 393) | async fn poll_next_many_enough() {
  function poll_next_many_correctly_loops_around (line 409) | async fn poll_next_many_correctly_loops_around() {
  function next_many_zero (line 452) | async fn next_many_zero() {
  function next_many_empty (line 463) | async fn next_many_empty() {
  function next_many_pending (line 472) | async fn next_many_pending() {
  function next_many_not_enough (line 491) | async fn next_many_not_enough() {
  function next_many_enough (line 507) | async fn next_many_enough() {
  function next_many_correctly_loops_around (line 523) | async fn next_many_correctly_loops_around() {

FILE: tokio-stream/tests/stream_timeout.rs
  function maybe_sleep (line 9) | async fn maybe_sleep(idx: i32) -> i32 {
  function ms (line 16) | fn ms(n: u64) -> Duration {
  function basic_usage (line 21) | async fn basic_usage() {
  function return_elapsed_errors_only_once (line 68) | async fn return_elapsed_errors_only_once() {
  function no_timeouts (line 98) | async fn no_timeouts() {

FILE: tokio-stream/tests/support/mpsc.rs
  function unbounded_channel_stream (line 5) | pub fn unbounded_channel_stream<T: Unpin>() -> (UnboundedSender<T>, impl...

FILE: tokio-stream/tests/time_throttle.rs
  function usage (line 11) | async fn usage() {

FILE: tokio-stream/tests/watch.rs
  function watch_stream_message_not_twice (line 10) | async fn watch_stream_message_not_twice() {
  function watch_stream_from_rx (line 34) | async fn watch_stream_from_rx() {
  function watch_stream_from_changes (line 47) | async fn watch_stream_from_changes() {

FILE: tokio-test/src/io.rs
  type Mock (line 40) | pub struct Mock {
    method maybe_wakeup_reader (line 347) | fn maybe_wakeup_reader(&mut self) {
    method pmsg (line 574) | fn pmsg(&self) -> PanicMsgSnippet<'_> {
  type Handle (line 46) | pub struct Handle {
    method read (line 159) | pub fn read(&mut self, buf: &[u8]) -> &mut Self {
    method read_error (line 168) | pub fn read_error(&mut self, error: io::Error) -> &mut Self {
    method write (line 178) | pub fn write(&mut self, buf: &[u8]) -> &mut Self {
    method write_error (line 187) | pub fn write_error(&mut self, error: io::Error) -> &mut Self {
  type Builder (line 52) | pub struct Builder {
    method new (line 80) | pub fn new() -> Self {
    method read (line 88) | pub fn read(&mut self, buf: &[u8]) -> &mut Self {
    method read_error (line 97) | pub fn read_error(&mut self, error: io::Error) -> &mut Self {
    method write (line 107) | pub fn write(&mut self, buf: &[u8]) -> &mut Self {
    method write_error (line 116) | pub fn write_error(&mut self, error: io::Error) -> &mut Self {
    method wait (line 126) | pub fn wait(&mut self, duration: Duration) -> &mut Self {
    method name (line 133) | pub fn name(&mut self, name: impl Into<String>) -> &mut Self {
    method build (line 139) | pub fn build(&mut self) -> Mock {
    method build_with_handle (line 145) | pub fn build_with_handle(&mut self) -> (Mock, Handle) {
  type Action (line 59) | enum Action {
  type Inner (line 69) | struct Inner {
    method new (line 195) | fn new(actions: VecDeque<Action>, name: String) -> (Inner, Handle) {
    method poll_action (line 214) | fn poll_action(&mut self, cx: &mut task::Context<'_>) -> Poll<Option<A...
    method read (line 218) | fn read(&mut self, dst: &mut ReadBuf<'_>) -> io::Result<()> {
    method write (line 246) | fn write(&mut self, mut src: &[u8]) -> io::Result<usize> {
    method remaining_wait (line 292) | fn remaining_wait(&mut self) -> Option<Duration> {
    method action (line 299) | fn action(&mut self) -> Option<&mut Action> {
    method fmt (line 547) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method poll_read (line 360) | fn poll_read(
  method poll_write (line 408) | fn poll_write(
  method poll_flush (line 492) | fn poll_flush(self: Pin<&mut Self>, _cx: &mut task::Context<'_>) -> Poll...
  method poll_shutdown (line 496) | fn poll_shutdown(self: Pin<&mut Self>, _cx: &mut task::Context<'_>) -> P...
  method drop (line 503) | fn drop(&mut self) {
  type PanicMsgSnippet (line 556) | struct PanicMsgSnippet<'a>(&'a Inner);
  function fmt (line 559) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

FILE: tokio-test/src/lib.rs
  function block_on (line 27) | pub fn block_on<F: std::future::Future>(future: F) -> F::Output {

FILE: tokio-test/src/stream_mock.rs
  type Action (line 47) | enum Action<T: Unpin> {
  type StreamMockBuilder (line 54) | pub struct StreamMockBuilder<T: Unpin> {
  function new (line 60) | pub fn new() -> Self {
  function next (line 65) | pub fn next(mut self, value: T) -> Self {
  function wait (line 79) | pub fn wait(mut self, duration: Duration) -> Self {
  function build (line 85) | pub fn build(self) -> StreamMock<T> {
  method default (line 94) | fn default() -> Self {
  type StreamMock (line 105) | pub struct StreamMock<T: Unpin> {
  function next_action (line 111) | fn next_action(&mut self) -> Option<Action<T>> {
  type Item (line 117) | type Item = T;
  method poll_next (line 119) | fn poll_next(
  method drop (line 147) | fn drop(&mut self) {

FILE: tokio-test/src/task.rs
  function spawn (line 42) | pub fn spawn<T>(task: T) -> Spawn<T> {
  type Spawn (line 53) | pub struct Spawn<T> {
  type MockTask (line 59) | struct MockTask {
    method new (line 159) | fn new() -> Self {
    method enter (line 169) | fn enter<F, R>(&mut self, f: F) -> R
    method is_woken (line 182) | fn is_woken(&self) -> bool {
    method waker_ref_count (line 189) | fn waker_ref_count(&self) -> usize {
    method waker (line 193) | fn waker(&self) -> Waker {
  type ThreadWaker (line 64) | struct ThreadWaker {
    method new (line 208) | fn new() -> Self {
    method clear (line 218) | fn clear(&self) {
    method is_woken (line 222) | fn is_woken(&self) -> bool {
    method wake (line 230) | fn wake(&self) {
  constant IDLE (line 69) | const IDLE: usize = 0;
  constant WAKE (line 70) | const WAKE: usize = 1;
  constant SLEEP (line 71) | const SLEEP: usize = 2;
  function into_inner (line 75) | pub fn into_inner(self) -> T
  function is_woken (line 84) | pub fn is_woken(&self) -> bool {
  function waker_ref_count (line 91) | pub fn waker_ref_count(&self) -> usize {
  function enter (line 96) | pub fn enter<F, R>(&mut self, f: F) -> R
  type Target (line 106) | type Target = T;
  function deref (line 108) | fn deref(&self) -> &T {
  function deref_mut (line 114) | fn deref_mut(&mut self) -> &mut T {
  function poll (line 122) | pub fn poll(&mut self) -> Poll<T::Output> {
  function poll_next (line 131) | pub fn poll_next(&mut self) -> Poll<Option<T::Item>> {
  type Output (line 138) | type Output = T::Output;
  method poll (line 140) | fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Ou...
  type Item (line 146) | type Item = T::Item;
  method poll_next (line 148) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...
  method size_hint (line 152) | fn size_hint(&self) -> (usize, Option<usize>) {
  method default (line 202) | fn default() -> Self {
  function to_raw (line 253) | unsafe fn to_raw(waker: Arc<ThreadWaker>) -> RawWaker {
  function from_raw (line 257) | unsafe fn from_raw(raw: *const ()) -> Arc<ThreadWaker> {
  function clone (line 261) | unsafe fn clone(raw: *const ()) -> RawWaker {
  function wake (line 270) | unsafe fn wake(raw: *const ()) {
  function wake_by_ref (line 275) | unsafe fn wake_by_ref(raw: *const ()) {
  function drop_waker (line 283) | unsafe fn drop_waker(raw: *const ()) {

FILE: tokio-test/tests/block_on.rs
  function async_block (line 7) | fn async_block() {
  function five (line 11) | async fn five() -> u8 {
  function async_fn (line 16) | fn async_fn() {
  function test_sleep (line 21) | fn test_sleep() {

FILE: tokio-test/tests/io.rs
  function read (line 9) | async fn read() {
  function read_error (line 22) | async fn read_error() {
  function write (line 47) | async fn write() {
  function write_with_handle (line 55) | async fn write_with_handle() {
  function read_with_handle (line 65) | async fn read_with_handle() {
  function write_error (line 78) | async fn write_error() {
  function mock_panics_read_data_left (line 100) | async fn mock_panics_read_data_left() {
  function mock_panics_write_data_left (line 107) | async fn mock_panics_write_data_left() {
  function wait (line 113) | async fn wait() {
  function multiple_wait (line 143) | async fn multiple_wait() {

FILE: tokio-test/tests/macros.rs
  function ready (line 8) | fn ready() -> Poll<()> {
  function ready_ok (line 12) | fn ready_ok() -> Poll<Result<(), ()>> {
  function ready_err (line 16) | fn ready_err() -> Poll<Result<(), ()>> {
  function pending (line 20) | fn pending() -> Poll<()> {
  type Test (line 25) | enum Test {
  function assert_ready (line 30) | fn assert_ready() {
  function assert_ready_on_pending (line 40) | fn assert_ready_on_pending() {
  function assert_pending (line 46) | fn assert_pending() {
  function assert_pending_on_ready (line 56) | fn assert_pending_on_ready() {
  function assert_ready_ok (line 62) | fn assert_ready_ok() {
  function assert_ok_on_err (line 72) | fn assert_ok_on_err() {
  function assert_ready_err (line 78) | fn assert_ready_err() {
  function assert_err_on_ok (line 88) | fn assert_err_on_ok() {
  function assert_ready_eq (line 94) | fn assert_ready_eq() {
  function assert_eq_on_not_eq (line 104) | fn assert_eq_on_not_eq() {

FILE: tokio-test/tests/stream_mock.rs
  function test_stream_mock_empty (line 6) | async fn test_stream_mock_empty() {
  function test_stream_mock_items (line 14) | async fn test_stream_mock_items() {
  function test_stream_mock_wait (line 23) | async fn test_stream_mock_wait() {
  function test_stream_mock_drop_without_consuming_all (line 40) | async fn test_stream_mock_drop_without_consuming_all() {
  function test_stream_mock_drop_during_panic_doesnt_mask_panic (line 47) | async fn test_stream_mock_drop_during_panic_doesnt_mask_panic() {

FILE: tokio-test/tests/task.rs
  type SizedStream (line 7) | struct SizedStream;
  type Item (line 10) | type Item = ();
  method poll_next (line 12) | fn poll_next(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Option...
  method size_hint (line 16) | fn size_hint(&self) -> (usize, Option<usize>) {
  function test_spawn_stream_size_hint (line 22) | fn test_spawn_stream_size_hint() {

FILE: tokio-util/src/codec/any_delimiter_codec.rs
  constant DEFAULT_SEEK_DELIMITERS (line 7) | const DEFAULT_SEEK_DELIMITERS: &[u8] = b",;\n\r";
  constant DEFAULT_SEQUENCE_WRITER (line 8) | const DEFAULT_SEQUENCE_WRITER: &[u8] = b",";
  type AnyDelimiterCodec (line 41) | pub struct AnyDelimiterCodec {
    method new (line 75) | pub fn new(seek_delimiters: Vec<u8>, sequence_writer: Vec<u8>) -> AnyD...
    method new_with_max_length (line 103) | pub fn new_with_max_length(
    method max_length (line 129) | pub fn max_length(&self) -> usize {
    type Error (line 214) | type Error = AnyDelimiterCodecError;
    method encode (line 216) | fn encode(&mut self, chunk: T, buf: &mut BytesMut) -> Result<(), AnyDe...
  type Item (line 135) | type Item = Bytes;
  type Error (line 136) | type Error = AnyDelimiterCodecError;
  method decode (line 138) | fn decode(&mut self, buf: &mut BytesMut) -> Result<Option<Bytes>, AnyDel...
  method decode_eof (line 193) | fn decode_eof(&mut self, buf: &mut BytesMut) -> Result<Option<Bytes>, An...
  method default (line 227) | fn default() -> Self {
  type AnyDelimiterCodecError (line 237) | pub enum AnyDelimiterCodecError {
    method fmt (line 245) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    method from (line 256) | fn from(e: io::Error) -> AnyDelimiterCodecError {

FILE: tokio-util/src/codec/bytes_codec.rs
  type BytesCodec (line 45) | pub struct BytesCodec(());
    method new (line 49) | pub fn new() -> BytesCodec {
    type Error (line 69) | type Error = io::Error;
    method encode (line 71) | fn encode(&mut self, data: Bytes, buf: &mut BytesMut) -> Result<(), io...
    type Error (line 79) | type Error = io::Error;
    method encode (line 81) | fn encode(&mut self, data: BytesMut, buf: &mut BytesMut) -> Result<(),...
  type Item (line 55) | type Item = BytesMut;
  type Error (line 56) | type Error = io::Error;
  method decode (line 58) | fn decode(&mut self, buf: &mut BytesMut) -> Result<Option<BytesMut>, io:...

FILE: tokio-util/src/codec/decoder.rs
  type Decoder (line 35) | pub trait Decoder {
    method decode (line 124) | fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Self::Item>,...
    method decode_eof (line 144) | fn decode_eof(&mut self, buf: &mut BytesMut) -> Result<Option<Self::It...
    method framed (line 178) | fn framed<T: AsyncRead + AsyncWrite + Sized>(self, io: T) -> Framed<T,...

FILE: tokio-util/src/codec/encoder.rs
  type Encoder (line 8) | pub trait Encoder<Item> {
    method encode (line 24) | fn encode(&mut self, item: Item, dst: &mut BytesMut) -> Result<(), Sel...

FILE: tokio-util/src/codec/framed.rs
  function new (line 73) | pub fn new(inner: T, codec: U) -> Framed<T, U> {
  function with_capacity (line 107) | pub fn with_capacity(inner: T, codec: U, capacity: usize) -> Framed<T, U> {
  function from_parts (line 155) | pub fn from_parts(parts: FramedParts<T, U>) -> Framed<T, U> {
  function get_ref (line 174) | pub fn get_ref(&self) -> &T {
  function get_mut (line 184) | pub fn get_mut(&mut self) -> &mut T {
  function get_pin_mut (line 194) | pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T> {
  function codec (line 203) | pub fn codec(&self) -> &U {
  function codec_mut (line 212) | pub fn codec_mut(&mut self) -> &mut U {
  function map_codec (line 221) | pub fn map_codec<C, F>(self, map: F) -> Framed<T, C>
  function codec_pin_mut (line 241) | pub fn codec_pin_mut(self: Pin<&mut Self>) -> &mut U {
  function read_buffer (line 246) | pub fn read_buffer(&self) -> &BytesMut {
  function read_buffer_mut (line 251) | pub fn read_buffer_mut(&mut self) -> &mut BytesMut {
  function write_buffer (line 256) | pub fn write_buffer(&self) -> &BytesMut {
  function write_buffer_mut (line 261) | pub fn write_buffer_mut(&mut self) -> &mut BytesMut {
  function backpressure_boundary (line 266) | pub fn backpressure_boundary(&self) -> usize {
  function set_backpressure_boundary (line 271) | pub fn set_backpressure_boundary(&mut self, boundary: usize) {
  function into_inner (line 280) | pub fn into_inner(self) -> T {
  function into_parts (line 290) | pub fn into_parts(self) -> FramedParts<T, U> {
  type Item (line 307) | type Item = Result<U::Item, U::Error>;
  method poll_next (line 309) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  type Error (line 321) | type Error = U::Error;
  function poll_ready (line 323) | fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  function start_send (line 327) | fn start_send(self: Pin<&mut Self>, item: I) -> Result<(), Self::Error> {
  function poll_flush (line 331) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  function poll_close (line 335) | fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  function fmt (line 345) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type FramedParts (line 360) | pub struct FramedParts<T, U> {
  function new (line 380) | pub fn new<I>(io: T, codec: U) -> FramedParts<T, U>

FILE: tokio-util/src/codec/framed_impl.rs
  constant INITIAL_CAPACITY (line 25) | const INITIAL_CAPACITY: usize = 8 * 1024;
  type ReadFrame (line 28) | pub(crate) struct ReadFrame {
    method from (line 67) | fn from(mut buffer: BytesMut) -> Self {
  type WriteFrame (line 35) | pub(crate) struct WriteFrame {
    method from (line 84) | fn from(mut buffer: BytesMut) -> Self {
  type RWFrames (line 41) | pub(crate) struct RWFrames {
    method borrow (line 98) | fn borrow(&self) -> &ReadFrame {
    method borrow_mut (line 103) | fn borrow_mut(&mut self) -> &mut ReadFrame {
    method borrow (line 108) | fn borrow(&self) -> &WriteFrame {
    method borrow_mut (line 113) | fn borrow_mut(&mut self) -> &mut WriteFrame {
  method default (line 47) | fn default() -> Self {
  method default (line 58) | fn default() -> Self {
  type Item (line 123) | type Item = Result<U::Item, U::Error>;
  method poll_next (line 125) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  type Error (line 260) | type Error = U::Error;
  function poll_ready (line 262) | fn poll_ready(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Re...
  function start_send (line 270) | fn start_send(self: Pin<&mut Self>, item: I) -> Result<(), Self::Error> {
  function poll_flush (line 278) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  function poll_close (line 306) | fn poll_close(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Re...

FILE: tokio-util/src/codec/framed_read.rs
  function new (line 41) | pub fn new(inner: T, decoder: D) -> FramedRead<T, D> {
  function with_capacity (line 53) | pub fn with_capacity(inner: T, decoder: D, capacity: usize) -> FramedRea...
  function get_ref (line 74) | pub fn get_ref(&self) -> &T {
  function get_mut (line 84) | pub fn get_mut(&mut self) -> &mut T {
  function get_pin_mut (line 94) | pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T> {
  function into_inner (line 103) | pub fn into_inner(self) -> T {
  function decoder (line 108) | pub fn decoder(&self) -> &D {
  function decoder_mut (line 113) | pub fn decoder_mut(&mut self) -> &mut D {
  function map_decoder (line 119) | pub fn map_decoder<C, F>(self, map: F) -> FramedRead<T, C>
  function decoder_pin_mut (line 139) | pub fn decoder_pin_mut(self: Pin<&mut Self>) -> &mut D {
  function read_buffer (line 144) | pub fn read_buffer(&self) -> &BytesMut {
  function read_buffer_mut (line 149) | pub fn read_buffer_mut(&mut self) -> &mut BytesMut {
  function into_parts (line 155) | pub fn into_parts(self) -> FramedParts<T, D> {
  type Item (line 172) | type Item = Result<D::Item, D::Error>;
  method poll_next (line 174) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  type Error (line 184) | type Error = T::Error;
  function poll_ready (line 186) | fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  function start_send (line 190) | fn start_send(self: Pin<&mut Self>, item: I) -> Result<(), Self::Error> {
  function poll_flush (line 194) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  function poll_close (line 198) | fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  function fmt (line 208) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

FILE: tokio-util/src/codec/framed_write.rs
  function new (line 40) | pub fn new(inner: T, encoder: E) -> FramedWrite<T, E> {
  function with_capacity (line 52) | pub fn with_capacity(inner: T, encoder: E, capacity: usize) -> FramedWri...
  function get_ref (line 71) | pub fn get_ref(&self) -> &T {
  function get_mut (line 81) | pub fn get_mut(&mut self) -> &mut T {
  function get_pin_mut (line 91) | pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut T> {
  function into_inner (line 100) | pub fn into_inner(self) -> T {
  function encoder (line 105) | pub fn encoder(&self) -> &E {
  function encoder_mut (line 110) | pub fn encoder_mut(&mut self) -> &mut E {
  function map_encoder (line 116) | pub fn map_encoder<C, F>(self, map: F) -> FramedWrite<T, C>
  function encoder_pin_mut (line 136) | pub fn encoder_pin_mut(self: Pin<&mut Self>) -> &mut E {
  function write_buffer (line 141) | pub fn write_buffer(&self) -> &BytesMut {
  function write_buffer_mut (line 146) | pub fn write_buffer_mut(&mut self) -> &mut BytesMut {
  function backpressure_boundary (line 151) | pub fn backpressure_boundary(&self) -> usize {
  function set_backpressure_boundary (line 156) | pub fn set_backpressure_boundary(&mut self, boundary: usize) {
  function into_parts (line 162) | pub fn into_parts(self) -> FramedParts<T, E> {
  type Error (line 180) | type Error = E::Error;
  function poll_ready (line 182) | fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  function start_send (line 186) | fn start_send(self: Pin<&mut Self>, item: I) -> Result<(), Self::Error> {
  function poll_flush (line 190) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  function poll_close (line 194) | fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  type Item (line 204) | type Item = T::Item;
  method poll_next (line 206) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  function fmt (line 216) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

FILE: tokio-util/src/codec/length_delimited.rs
  type Builder (line 416) | pub struct Builder {
    method new (line 691) | pub fn new() -> Builder {
    method big_endian (line 732) | pub fn big_endian(&mut self) -> &mut Self {
    method little_endian (line 756) | pub fn little_endian(&mut self) -> &mut Self {
    method native_endian (line 780) | pub fn native_endian(&mut self) -> &mut Self {
    method max_frame_length (line 814) | pub fn max_frame_length(&mut self, val: usize) -> &mut Self {
    method length_field_type (line 851) | pub fn length_field_type<T: builder::LengthFieldType>(&mut self) -> &m...
    method length_field_length (line 874) | pub fn length_field_length(&mut self, val: usize) -> &mut Self {
    method length_field_offset (line 897) | pub fn length_field_offset(&mut self, val: usize) -> &mut Self {
    method length_adjustment (line 918) | pub fn length_adjustment(&mut self, val: isize) -> &mut Self {
    method num_skip (line 942) | pub fn num_skip(&mut self, val: usize) -> &mut Self {
    method new_codec (line 962) | pub fn new_codec(&self) -> LengthDelimitedCodec {
    method new_read (line 991) | pub fn new_read<T>(&self, upstream: T) -> FramedRead<T, LengthDelimite...
    method new_write (line 1012) | pub fn new_write<T>(&self, inner: T) -> FramedWrite<T, LengthDelimited...
    method new_framed (line 1034) | pub fn new_framed<T>(&self, inner: T) -> Framed<T, LengthDelimitedCodec>
    method num_head_bytes (line 1041) | fn num_head_bytes(&self) -> usize {
    method get_num_skip (line 1046) | fn get_num_skip(&self) -> usize {
    method adjust_max_frame_len (line 1051) | fn adjust_max_frame_len(&mut self) {
  type LengthDelimitedCodecError (line 438) | pub struct LengthDelimitedCodecError {
    method fmt (line 1075) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    method fmt (line 1081) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type LengthDelimitedCodec (line 451) | pub struct LengthDelimitedCodec {
    method new (line 469) | pub fn new() -> Self {
    method builder (line 478) | pub fn builder() -> Builder {
    method max_frame_length (line 486) | pub fn max_frame_length(&self) -> usize {
    method set_max_frame_length (line 496) | pub fn set_max_frame_length(&mut self, val: usize) {
    method decode_head (line 500) | fn decode_head(&mut self, src: &mut BytesMut) -> io::Result<Option<usi...
    method decode_data (line 560) | fn decode_data(&self, n: usize, src: &mut BytesMut) -> Option<BytesMut> {
    type Error (line 603) | type Error = io::Error;
    method encode (line 605) | fn encode(&mut self, data: Bytes, dst: &mut BytesMut) -> Result<(), io...
  type DecodeState (line 460) | enum DecodeState {
  type Item (line 572) | type Item = BytesMut;
  type Error (line 573) | type Error = io::Error;
  method decode (line 575) | fn decode(&mut self, src: &mut BytesMut) -> io::Result<Option<BytesMut>> {
  method default (line 647) | fn default() -> Self {
  type LengthFieldType (line 656) | pub trait LengthFieldType {}
  method default (line 1067) | fn default() -> Self {

FILE: tokio-util/src/codec/lines_codec.rs
  type LinesCodec (line 14) | pub struct LinesCodec {
    method new (line 42) | pub fn new() -> LinesCodec {
    method new_with_max_length (line 68) | pub fn new_with_max_length(max_length: usize) -> Self {
    method max_length (line 90) | pub fn max_length(&self) -> usize {
    type Error (line 191) | type Error = LinesCodecError;
    method encode (line 193) | fn encode(&mut self, line: T, buf: &mut BytesMut) -> Result<(), LinesC...
  function utf8 (line 95) | fn utf8(buf: &[u8]) -> Result<&str, io::Error> {
  function without_carriage_return (line 100) | fn without_carriage_return(s: &[u8]) -> &[u8] {
  type Item (line 109) | type Item = String;
  type Error (line 110) | type Error = LinesCodecError;
  method decode (line 112) | fn decode(&mut self, buf: &mut BytesMut) -> Result<Option<String>, Lines...
  method decode_eof (line 168) | fn decode_eof(&mut self, buf: &mut BytesMut) -> Result<Option<String>, L...
  method default (line 203) | fn default() -> Self {
  type LinesCodecError (line 210) | pub enum LinesCodecError {
    method fmt (line 218) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    method from (line 227) | fn from(e: io::Error) -> LinesCodecError {

FILE: tokio-util/src/compat.rs
  type FuturesAsyncReadCompatExt (line 132) | pub trait FuturesAsyncReadCompatExt: futures_io::AsyncRead {
    method compat (line 135) | fn compat(self) -> Compat<Self>
  type FuturesAsyncWriteCompatExt (line 147) | pub trait FuturesAsyncWriteCompatExt: futures_io::AsyncWrite {
    method compat_write (line 150) | fn compat_write(self) -> Compat<Self>
  type TokioAsyncReadCompatExt (line 162) | pub trait TokioAsyncReadCompatExt: tokio::io::AsyncRead {
    method compat (line 165) | fn compat(self) -> Compat<Self>
  type TokioAsyncWriteCompatExt (line 177) | pub trait TokioAsyncWriteCompatExt: tokio::io::AsyncWrite {
    method compat_write (line 180) | fn compat_write(self) -> Compat<Self>
  function new (line 193) | fn new(inner: T) -> Self {
  function get_ref (line 202) | pub fn get_ref(&self) -> &T {
  function get_mut (line 208) | pub fn get_mut(&mut self) -> &mut T {
  function into_inner (line 213) | pub fn into_inner(self) -> T {
  function poll_read (line 222) | fn poll_read(
  function poll_read (line 244) | fn poll_read(
  function poll_fill_buf (line 263) | fn poll_fill_buf<'a>(
  function consume (line 270) | fn consume(self: Pin<&mut Self>, amt: usize) {
  function poll_fill_buf (line 279) | fn poll_fill_buf<'a>(
  function consume (line 286) | fn consume(self: Pin<&mut Self>, amt: usize) {
  function poll_write (line 295) | fn poll_write(
  function poll_flush (line 303) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Re...
  function poll_shutdown (line 307) | fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io:...
  function poll_write (line 316) | fn poll_write(
  function poll_flush (line 324) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Re...
  function poll_close (line 328) | fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Re...
  function poll_seek (line 334) | fn poll_seek(
  function start_seek (line 352) | fn start_seek(mut self: Pin<&mut Self>, pos: io::SeekFrom) -> io::Result...
  function poll_complete (line 357) | fn poll_complete(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll...
  function as_raw_fd (line 376) | fn as_raw_fd(&self) -> std::os::unix::io::RawFd {
  function as_raw_handle (line 383) | fn as_raw_handle(&self) -> std::os::windows::io::RawHandle {

FILE: tokio-util/src/context.rs
  function new (line 119) | pub fn new(future: F, handle: Handle) -> TokioContext<F> {
  function handle (line 127) | pub fn handle(&self) -> &Handle {
  function into_inner (line 132) | pub fn into_inner(self) -> F {
  type Output (line 138) | type Output = F::Output;
  method poll (line 140) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
  type RuntimeExt (line 151) | pub trait RuntimeExt {
    method wrap (line 189) | fn wrap<F: Future>(&self, fut: F) -> TokioContext<F>;
    method wrap (line 193) | fn wrap<F: Future>(&self, fut: F) -> TokioContext<F> {

FILE: tokio-util/src/either.rs
  type Either (line 64) | pub enum Either<L, R> {
  type Output (line 88) | type Output = O;
  method poll (line 90) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
  method poll_read (line 100) | fn poll_read(
  method poll_fill_buf (line 114) | fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Res...
  method consume (line 118) | fn consume(self: Pin<&mut Self>, amt: usize) {
  method start_seek (line 128) | fn start_seek(self: Pin<&mut Self>, position: SeekFrom) -> Result<()> {
  method poll_complete (line 132) | fn poll_complete(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Res...
  method poll_write (line 142) | fn poll_write(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8]) ->...
  method poll_flush (line 146) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<tokio:...
  method poll_shutdown (line 150) | fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<tok...
  method poll_write_vectored (line 154) | fn poll_write_vectored(
  method is_write_vectored (line 162) | fn is_write_vectored(&self) -> bool {
  type Item (line 175) | type Item = L::Item;
  function poll_next (line 177) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  type Error (line 187) | type Error = Error;
  function poll_ready (line 189) | fn poll_ready(
  function start_send (line 196) | fn start_send(self: Pin<&mut Self>, item: Item) -> std::result::Result<(...
  function poll_flush (line 200) | fn poll_flush(
  function poll_close (line 207) | fn poll_close(
  function either_is_stream (line 222) | async fn either_is_stream() {
  function either_is_async_read (line 229) | async fn either_is_async_read() {

FILE: tokio-util/src/future.rs
  type FutureExt (line 11) | pub trait FutureExt: Future {
    method with_cancellation_token (line 89) | fn with_cancellation_token(
    method with_cancellation_token_owned (line 126) | fn with_cancellation_token_owned(

FILE: tokio-util/src/future/with_cancellation_token.rs
  function new (line 26) | pub(crate) fn new(cancellation_token: &'a CancellationToken, future: F) ...
  type Output (line 35) | type Output = Option<F::Output>;
  method poll (line 37) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
  function new (line 61) | pub(crate) fn new(cancellation_token: CancellationToken, future: F) -> S...
  type Output (line 70) | type Output = Option<F::Output>;
  method poll (line 72) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {

FILE: tokio-util/src/io/copy_to_bytes.rs
  function new (line 26) | pub fn new(inner: S) -> Self {
  function get_ref (line 31) | pub fn get_ref(&self) -> &S {
  function get_mut (line 36) | pub fn get_mut(&mut self) -> &mut S {
  function into_inner (line 41) | pub fn into_inner(self) -> S {
  type Error (line 50) | type Error = S::Error;
  function poll_ready (line 52) | fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  function start_send (line 56) | fn start_send(self: Pin<&mut Self>, item: &'a [u8]) -> Result<(), Self::...
  function poll_flush (line 62) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  function poll_close (line 66) | fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  type Item (line 72) | type Item = S::Item;
  method poll_next (line 73) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...

FILE: tokio-util/src/io/inspect.rs
  function new (line 26) | pub fn new(reader: R, f: F) -> InspectReader<R, F>
  function into_inner (line 35) | pub fn into_inner(self) -> R {
  method poll_read (line 41) | fn poll_read(
  method poll_write (line 55) | fn poll_write(
  method poll_flush (line 63) | fn poll_flush(
  method poll_shutdown (line 70) | fn poll_shutdown(
  method poll_write_vectored (line 77) | fn poll_write_vectored(
  method is_write_vectored (line 85) | fn is_write_vectored(&self) -> bool {
  function new (line 108) | pub fn new(writer: W, f: F) -> InspectWriter<W, F>
  function into_inner (line 117) | pub fn into_inner(self) -> W {
  method poll_write (line 123) | fn poll_write(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8]) ->...
  method poll_flush (line 134) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  method poll_shutdown (line 139) | fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Res...
  method poll_write_vectored (line 144) | fn poll_write_vectored(
  method is_write_vectored (line 166) | fn is_write_vectored(&self) -> bool {
  method poll_read (line 172) | fn poll_read(

FILE: tokio-util/src/io/read_arc.rs
  function read_exact_arc (line 25) | pub async fn read_exact_arc<R: AsyncRead>(read: R, len: usize) -> io::Re...

FILE: tokio-util/src/io/read_buf.rs
  function read_buf (line 43) | pub async fn read_buf<R, B>(read: &mut R, buf: &mut B) -> io::Result<usize>

FILE: tokio-util/src/io/reader_stream.rs
  constant DEFAULT_CAPACITY (line 8) | const DEFAULT_CAPACITY: usize = 4096;
  function new (line 68) | pub fn new(reader: R) -> Self {
  function with_capacity (line 82) | pub fn with_capacity(reader: R, capacity: usize) -> Self {
  type Item (line 92) | type Item = std::io::Result<Bytes>;
  method poll_next (line 93) | fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Opt...

FILE: tokio-util/src/io/simplex.rs
  type IoResult (line 16) | type IoResult<T> = Result<T, IoError>;
  constant CLOSED_ERROR_MSG (line 18) | const CLOSED_ERROR_MSG: &str = "simplex has been closed";
  type Inner (line 21) | struct Inner {
    method with_capacity (line 39) | fn with_capacity(capacity: usize) -> Self {
    method register_receiver_waker (line 49) | fn register_receiver_waker(&mut self, waker: &Waker) -> Option<Waker> {
    method register_sender_waker (line 56) | fn register_sender_waker(&mut self, waker: &Waker) -> Option<Waker> {
    method take_receiver_waker (line 63) | fn take_receiver_waker(&mut self) -> Option<Waker> {
    method take_sender_waker (line 67) | fn take_sender_waker(&mut self) -> Option<Waker> {
    method is_closed (line 71) | fn is_closed(&self) -> bool {
    method close_receiver (line 75) | fn close_receiver(&mut self) -> Option<Waker> {
    method close_sender (line 80) | fn close_sender(&mut self) -> Option<Waker> {
  type Receiver (line 101) | pub struct Receiver {
  method drop (line 107) | fn drop(&mut self) {
  method poll_read (line 120) | fn poll_read(
  type Sender (line 177) | pub struct Sender {
  method drop (line 183) | fn drop(&mut self) {
  method poll_write (line 200) | fn poll_write(self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8]) ->...
  method poll_flush (line 250) | fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<IoRes...
  method poll_shutdown (line 265) | fn poll_shutdown(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Io...
  method is_write_vectored (line 278) | fn is_write_vectored(&self) -> bool {
  method poll_write_vectored (line 282) | fn poll_write_vectored(
  function new (line 351) | pub fn new(capacity: usize) -> (Sender, Receiver) {

FILE: tokio-util/src/io/sink_writer.rs
  function new (line 72) | pub fn new(sink: S) -> Self {
  function get_ref (line 77) | pub fn get_ref(&self) -> &S {
  function get_mut (line 82) | pub fn get_mut(&mut self) -> &mut S {
  function into_inner (line 87) | pub fn into_inner(self) -> S {
  method poll_write (line 96) | fn poll_write(
  method poll_flush (line 110) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  method poll_shutdown (line 114) | fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Res...
  type Item (line 120) | type Item = S::Item;
  method poll_next (line 121) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  method poll_read (line 127) | fn poll_read(

FILE: tokio-util/src/io/stream_reader.rs
  type StreamReader (line 156) | pub struct StreamReader<S, B> {
  function new (line 178) | pub fn new(stream: S) -> Self {
  function has_chunk (line 186) | fn has_chunk(&self) -> bool {
  function into_inner_with_chunk (line 197) | pub fn into_inner_with_chunk(self) -> (S, Option<B>) {
  function get_ref (line 210) | pub fn get_ref(&self) -> &S {
  function get_mut (line 217) | pub fn get_mut(&mut self) -> &mut S {
  function get_pin_mut (line 224) | pub fn get_pin_mut(self: Pin<&mut Self>) -> Pin<&mut S> {
  function into_inner (line 235) | pub fn into_inner(self) -> S {
  method poll_read (line 246) | fn poll_read(
  method poll_fill_buf (line 274) | fn poll_fill_buf(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll...
  method consume (line 293) | fn consume(self: Pin<&mut Self>, amt: usize) {
  type StreamReaderProject (line 311) | struct StreamReaderProject<'a, S, B> {
  function project (line 318) | fn project(self: Pin<&mut Self>) -> StreamReaderProject<'_, S, B> {
  type Error (line 330) | type Error = E;
  function poll_ready (line 331) | fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  function start_send (line 335) | fn start_send(self: Pin<&mut Self>, item: T) -> Result<(), Self::Error> {
  function poll_flush (line 339) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  function poll_close (line 343) | fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...

FILE: tokio-util/src/io/sync_bridge.rs
  type SyncIoBridge (line 264) | pub struct SyncIoBridge<T> {
  method fill_buf (line 270) | fn fill_buf(&mut self) -> std::io::Result<&[u8]> {
  method consume (line 275) | fn consume(&mut self, amt: usize) {
  method read_until (line 280) | fn read_until(&mut self, byte: u8, buf: &mut Vec<u8>) -> std::io::Result...
  method read_line (line 285) | fn read_line(&mut self, buf: &mut String) -> std::io::Result<usize> {
  method read (line 292) | fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
  method read_to_end (line 297) | fn read_to_end(&mut self, buf: &mut Vec<u8>) -> std::io::Result<usize> {
  method read_to_string (line 302) | fn read_to_string(&mut self, buf: &mut String) -> std::io::Result<usize> {
  method read_exact (line 307) | fn read_exact(&mut self, buf: &mut [u8]) -> std::io::Result<()> {
  method write (line 316) | fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
  method flush (line 321) | fn flush(&mut self) -> std::io::Result<()> {
  method write_all (line 326) | fn write_all(&mut self, buf: &[u8]) -> std::io::Result<()> {
  method write_vectored (line 331) | fn write_vectored(&mut self, bufs: &[std::io::IoSlice<'_>]) -> std::io::...
  method seek (line 338) | fn seek(&mut self, pos: std::io::SeekFrom) -> std::io::Result<u64> {
  function is_write_vectored (line 350) | pub fn is_write_vectored(&self) -> bool {
  function shutdown (line 364) | pub fn shutdown(&mut self) -> std::io::Result<()> {
  function new (line 393) | pub fn new(src: T) -> Self {
  function new_with_handle (line 402) | pub fn new_with_handle(src: T, rt: tokio::runtime::Handle) -> Self {
  function into_inner (line 407) | pub fn into_inner(self) -> T {
  function as_mut (line 413) | fn as_mut(&mut self) -> &mut T {
  function as_ref (line 419) | fn as_ref(&self) -> &T {

FILE: tokio-util/src/io/write_all_vectored.rs
  function write_all_vectored (line 86) | pub fn write_all_vectored<'a, 'b, W>(
  type Output (line 104) | type Output = io::Result<()>;
  method poll (line 106) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Result<(...
  function advance_slices (line 131) | fn advance_slices<'a>(bufs: &mut &mut [IoSlice<'a>], n: usize) {

FILE: tokio-util/src/net/mod.rs
  type Listener (line 15) | pub trait Listener {
    method poll_accept (line 22) | fn poll_accept(&mut self, cx: &mut Context<'_>) -> Poll<Result<(Self::...
    method accept (line 25) | fn accept(&mut self) -> ListenerAcceptFut<'_, Self>
    method local_addr (line 33) | fn local_addr(&self) -> Result<Self::Addr>;
    type Io (line 37) | type Io = tokio::net::TcpStream;
    type Addr (line 38) | type Addr = std::net::SocketAddr;
    method poll_accept (line 40) | fn poll_accept(&mut self, cx: &mut Context<'_>) -> Poll<Result<(Self::...
    method local_addr (line 44) | fn local_addr(&self) -> Result<Self::Addr> {
  type ListenerAcceptFut (line 52) | pub struct ListenerAcceptFut<'a, L> {
  type Output (line 60) | type Output = Result<(L::Io, L::Addr)>;
  method poll (line 62) | fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Ou...
  function accept (line 73) | pub async fn accept(&mut self) -> Result<Either<(L::Io, L::Addr), (R::Io...
  function local_addr (line 87) | pub fn local_addr(&self) -> Result<Either<L::Addr, R::Addr>> {

FILE: tokio-util/src/net/unix/mod.rs
  type Io (line 8) | type Io = tokio::net::UnixStream;
  type Addr (line 9) | type Addr = tokio::net::unix::SocketAddr;
  method poll_accept (line 11) | fn poll_accept(&mut self, cx: &mut Context<'_>) -> Poll<Result<(Self::Io...
  method local_addr (line 15) | fn local_addr(&self) -> Result<Self::Addr> {

FILE: tokio-util/src/sync/cancellation_token.rs
  type CancellationToken (line 57) | pub struct CancellationToken {
    method fmt (line 107) | fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
    method new (line 139) | pub fn new() -> CancellationToken {
    method child_token (line 184) | pub fn child_token(&self) -> CancellationToken {
    method cancel (line 200) | pub fn cancel(&self) {
    method is_cancelled (line 205) | pub fn is_cancelled(&self) -> bool {
    method cancelled (line 223) | pub fn cancelled(&self) -> WaitForCancellationFuture<'_> {
    method cancelled_owned (line 247) | pub fn cancelled_owned(self) -> WaitForCancellationFutureOwned {
    method drop_guard (line 255) | pub fn drop_guard(self) -> DropGuard {
    method drop_guard_ref (line 263) | pub fn drop_guard_ref(&self) -> DropGuardRef<'_> {
    method run_until_cancelled (line 280) | pub async fn run_until_cancelled<F>(&self, fut: F) -> Option<F::Output>
    method run_until_cancelled_owned (line 310) | pub async fn run_until_cancelled_owned<F>(self, fut: F) -> Option<F::O...
  method clone (line 117) | fn clone(&self) -> Self {
  method drop (line 126) | fn drop(&mut self) {
  method default (line 132) | fn default() -> CancellationToken {
  function fmt (line 321) | fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
  type Output (line 327) | type Output = ();
  method poll (line 329) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()> {
  method fmt (line 352) | fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
  method new (line 358) | fn new(cancellation_token: CancellationToken) -> Self {
  method new_future (line 375) | unsafe fn new_future(
  type Output (line 387) | type Output = ();
  method poll (line 389) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()> {
  function new (line 429) | pub(crate) fn new(cancellation_token: &'a CancellationToken, future: F) ...
  type Output (line 438) | type Output = Option<F::Output>;
  method poll (line 440) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
  type Output (line 466) | type Output = Option<F::Output>;
  method poll (line 468) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
  function new (line 481) | pub(crate) fn new(cancellation_token: CancellationToken, future: F) -> S...

FILE: tokio-util/src/sync/cancellation_token/guard.rs
  type DropGuard (line 8) | pub struct DropGuard {
    method disarm (line 16) | pub fn disarm(mut self) -> CancellationToken {
  method drop (line 24) | fn drop(&mut self) {

FILE: tokio-util/src/sync/cancellation_token/guard_ref.rs
  type DropGuardRef (line 11) | pub struct DropGuardRef<'a> {
  function disarm (line 19) | pub fn disarm(mut self) -> &'a CancellationToken {
  method drop (line 27) | fn drop(&mut self) {

FILE: tokio-util/src/sync/cancellation_token/tree_node.rs
  type TreeNode (line 46) | pub(crate) struct TreeNode {
    method new (line 51) | pub(crate) fn new() -> Self {
    method notified (line 64) | pub(crate) fn notified(&self) -> tokio::sync::futures::Notified<'_> {
  type Inner (line 73) | struct Inner {
  function is_cancelled (line 82) | pub(crate) fn is_cancelled(node: &Arc<TreeNode>) -> bool {
  function child_node (line 87) | pub(crate) fn child_node(parent: &Arc<TreeNode>) -> Arc<TreeNode> {
  function disconnect_children (line 125) | fn disconnect_children(node: &mut Inner) {
  function with_locked_node_and_parent (line 150) | fn with_locked_node_and_parent<F, Ret>(node: &Arc<TreeNode>, func: F) ->...
  function move_children_to_parent (line 202) | fn move_children_to_parent(node: &mut Inner, parent: &mut Inner) {
  function remove_child (line 220) | fn remove_child(parent: &mut Inner, mut node: MutexGuard<'_, Inner>) {
  function increase_handle_refcount (line 249) | pub(crate) fn increase_handle_refcount(node: &Arc<TreeNode>) {
  function decrease_handle_refcount (line 263) | pub(crate) fn decrease_handle_refcount(node: &Arc<TreeNode>) {
  function cancel (line 297) | pub(crate) fn cancel(node: &Arc<TreeNode>) {

FILE: tokio-util/src/sync/mpsc.rs
  type PollSendError (line 12) | pub struct PollSendError<T>(Option<T>);
  function into_inner (line 19) | pub fn into_inner(self) -> Option<T> {
  function fmt (line 25) | fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
  type State (line 33) | enum State<T> {
  type PollSender (line 44) | pub struct PollSender<T> {
  function make_acquire_future (line 55) | async fn make_acquire_future<T>(
  type InnerFuture (line 67) | type InnerFuture<'a, T> = ReusableBoxFuture<'a, Result<OwnedPermit<T>, P...
  type PollSenderFuture (line 71) | struct PollSenderFuture<T>(InnerFuture<'static, T>);
  function empty (line 75) | fn empty() -> Self {
  function new (line 84) | fn new() -> Self {
  function poll (line 91) | fn poll(&mut self, cx: &mut Context<'_>) -> Poll<Result<OwnedPermit<T>, ...
  function set (line 96) | fn set(&mut self, sender: Option<Sender<T>>) {
  function new (line 112) | pub fn new(sender: Sender<T>) -> Self {
  function take_state (line 120) | fn take_state(&mut self) -> State<T> {
  function poll_reserve (line 137) | pub fn poll_reserve(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), ...
  function send_item (line 183) | pub fn send_item(&mut self, value: T) -> Result<(), PollSendError<T>> {
  function is_closed (line 206) | pub fn is_closed(&self) -> bool {
  function get_ref (line 214) | pub fn get_ref(&self) -> Option<&Sender<T>> {
  function close (line 230) | pub fn close(&mut self) {
  function abort_send (line 252) | pub fn abort_send(&mut self) -> bool {
  method clone (line 292) | fn clone(&self) -> PollSender<T> {
  type Error (line 307) | type Error = PollSendError<T>;
  function poll_ready (line 309) | fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  function poll_flush (line 313) | fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Resul...
  function start_send (line 317) | fn start_send(self: Pin<&mut Self>, item: T) -> Result<(), Self::Error> {
  function poll_close (line 321) | fn poll_close(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Resul...

FILE: tokio-util/src/sync/poll_semaphore.rs
  type PollSemaphore (line 13) | pub struct PollSemaphore {
    method new (line 23) | pub fn new(semaphore: Arc<Semaphore>) -> Self {
    method close (line 31) | pub fn close(&self) {
    method clone_inner (line 36) | pub fn clone_inner(&self) -> Arc<Semaphore> {
    method into_inner (line 41) | pub fn into_inner(self) -> Arc<Semaphore> {
    method poll_acquire (line 58) | pub fn poll_acquire(&mut self, cx: &mut Context<'_>) -> Poll<Option<Ow...
    method poll_acquire_many (line 75) | pub fn poll_acquire_many(
    method available_permits (line 127) | pub fn available_permits(&self) -> usize {
    method add_permits (line 140) | pub fn add_permits(&self, n: usize) {
    method fmt (line 160) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
    method as_ref (line 168) | fn as_ref(&self) -> &Semaphore {
  type Item (line 146) | type Item = OwnedSemaphorePermit;
  method poll_next (line 148) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  method clone (line 154) | fn clone(&self) -> PollSemaphore {

FILE: tokio-util/src/sync/reusable_box.rs
  type ReusableBoxFuture (line 13) | pub struct ReusableBoxFuture<'a, T> {
  function new (line 19) | pub fn new<F>(future: F) -> Self
  function set (line 32) | pub fn set<F>(&mut self, future: F)
  function try_set (line 46) | pub fn try_set<F>(&mut self, future: F) -> Result<(), F>
  function get_pin (line 71) | pub fn get_pin(&mut self) -> Pin<&mut (dyn Future<Output = T> + Send)> {
  function poll (line 76) | pub fn poll(&mut self, cx: &mut Context<'_>) -> Poll<T> {
  type Output (line 82) | type Output = T;
  method poll (line 85) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<T> {
  function fmt (line 96) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function reuse_pin_box (line 101) | fn reuse_pin_box<T: ?Sized, U, O, F>(boxed: Pin<Box<T>>, new_value: U, c...
  type CallOnDrop (line 136) | struct CallOnDrop<O, F: FnOnce() -> O> {
  function new (line 141) | fn new(f: F) -> Self {
  function call (line 145) | fn call(self) -> O {
  method drop (line 153) | fn drop(&mut self) {

FILE: tokio-util/src/sync/tests/loom_cancellation_token.rs
  function cancel_token (line 7) | fn cancel_token() {
  function cancel_token_owned (line 28) | fn cancel_token_owned() {
  function cancel_with_child (line 49) | fn cancel_with_child() {
  function drop_token_no_child (line 79) | fn drop_token_no_child() {
  function drop_token_with_children (line 107) | fn drop_token_with_children() {
  function drop_and_cancel_token (line 135) | fn drop_and_cancel_token() {
  function cancel_parent_and_child (line 163) | fn cancel_parent_and_child() {

FILE: tokio-util/src/task/abort_on_drop.rs
  type AbortOnDropHandle (line 21) | pub struct AbortOnDropHandle<T>(JoinHandle<T>);
  method drop (line 24) | fn drop(&mut self) {
  function new (line 31) | pub fn new(handle: JoinHandle<T>) -> Self {
  function abort (line 38) | pub fn abort(&self) {
  function is_finished (line 45) | pub fn is_finished(&self) -> bool {
  function abort_handle (line 51) | pub fn abort_handle(&self) -> AbortHandle {
  function detach (line 56) | pub fn detach(self) -> JoinHandle<T> {
  function fmt (line 66) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  type Output (line 74) | type Output = Result<T, JoinError>;
  method poll (line 76) | fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Ou...
  function as_ref (line 82) | fn as_ref(&self) -> &JoinHandle<T> {
  type AbortOnDrop (line 97) | pub struct AbortOnDrop(AbortHandle);
    method new (line 107) | pub fn new(handle: AbortHandle) -> Self {
    method abort (line 114) | pub fn abort(&self) {
    method is_finished (line 121) | pub fn is_finished(&self) -> bool {
    method detach (line 126) | pub fn detach(self) -> AbortHandle {
    method fmt (line 136) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  method drop (line 100) | fn drop(&mut self) {
  type NotDebug (line 148) | struct NotDebug;
  function is_debug (line 150) | fn is_debug<T: std::fmt::Debug>() {}
  function assert_debug (line 153) | fn assert_debug() {

FILE: tokio-util/src/task/join_map.rs
  type JoinMap (line 98) | pub struct JoinMap<K, V, S = RandomState> {
  function new (line 131) | pub fn new() -> Self {
  function with_capacity (line 148) | pub fn with_capacity(capacity: usize) -> Self {
  function with_hasher (line 168) | pub fn with_hasher(hash_builder: S) -> Self {
  function with_capacity_and_hasher (line 201) | pub fn with_capacity_and_hasher(capacity: usize, hash_builder: S) -> Self {
  function len (line 210) | pub fn len(&self) -> usize {
  function is_empty (line 217) | pub fn is_empty(&self) -> bool {
  function capacity (line 237) | pub fn capacity(&self) -> usize {
  function spawn (line 264) | pub fn spawn<F>(&mut self, key: K, task: F)
  function spawn_on (line 284) | pub fn spawn_on<F>(&mut self, key: K, task: F, handle: &Handle)
  function spawn_blocking (line 313) | pub fn spawn_blocking<F>(&mut self, key: K, f: F)
  function spawn_blocking_on (line 338) | pub fn spawn_blocking_on<F>(&mut self, key: K, f: F, handle: &Handle)
  function spawn_local (line 364) | pub fn spawn_local<F>(&mut self, key: K, task: F)
  function spawn_local_on (line 384) | pub fn spawn_local_on<F>(&mut self, key: K, task: F, local_set: &LocalSet)
  function insert (line 393) | fn insert(&mut self, mut key: K, mut abort: AbortHandle) {
  function join_next (line 455) | pub async fn join_next(&mut self) -> Option<(K, Result<V, JoinError>)> {
  function shutdown (line 481) | pub async fn shutdown(&mut self) {
  function abort (line 539) | pub fn abort<Q>(&mut self, key: &Q) -> bool
  function abort_matching (line 606) | pub fn abort_matching(&mut self, mut predicate: impl FnMut(&K) -> bool) {
  function keys (line 623) | pub fn keys(&self) -> JoinMapKeys<'_, K, V> {
  function contains_key (line 636) | pub fn contains_key<Q>(&self, key: &Q) -> bool
  function contains_task (line 652) | pub fn contains_task(&self, task: &Id) -> bool {
  function reserve (line 676) | pub fn reserve(&mut self, additional: usize) {
  function shrink_to_fit (line 703) | pub fn shrink_to_fit(&mut self) {
  function shrink_to (line 733) | pub fn shrink_to(&mut self, min_capacity: usize) {
  function get_by_key (line 741) | fn get_by_key<'map, Q>(&'map self, key: &Q) -> Option<&'map (K, AbortHan...
  function remove_by_id (line 751) | fn remove_by_id(&mut self, id: Id) -> Option<K> {
  function abort_all (line 775) | pub fn abort_all(&mut self) {
  function detach_all (line 783) | pub fn detach_all(&mut self) {
  function fmt (line 793) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method default (line 818) | fn default() -> Self {
  type JoinMapKeys (line 825) | pub struct JoinMapKeys<'a, K, V> {
  type Item (line 833) | type Item = &'a K;
  method next (line 835) | fn next(&mut self) -> Option<&'a K> {
  method size_hint (line 839) | fn size_hint(&self) -> (usize, Option<usize>) {
  method len (line 845) | fn len(&self) -> usize {

FILE: tokio-util/src/task/join_queue.rs
  type JoinQueue (line 24) | pub struct JoinQueue<T>(VecDeque<AbortOnDropHandle<T>>);
  function new (line 28) | pub const fn new() -> Self {
  function with_capacity (line 33) | pub fn with_capacity(capacity: usize) -> Self {
  function len (line 42) | pub fn len(&self) -> usize {
  function is_empty (line 47) | pub fn is_empty(&self) -> bool {
  function spawn (line 64) | pub fn spawn<F>(&mut self, task: F) -> AbortHandle
  function spawn_on (line 82) | pub fn spawn_on<F>(&mut self, task: F, handle: &Handle) -> AbortHandle
  function spawn_local (line 106) | pub fn spawn_local<F>(&mut self, task: F) -> AbortHandle
  function spawn_blocking (line 124) | pub fn spawn_blocking<F>(&mut self, f: F) -> AbortHandle
  function spawn_blocking_on (line 138) | pub fn spawn_blocking_on<F>(&mut self, f: F, handle: &Handle) -> AbortHa...
  function push_back (line 146) | fn push_back(&mut self, jh: JoinHandle<T>) -> AbortHandle {
  function join_next (line 162) | pub async fn join_next(&mut self) -> Option<Result<T, JoinError>> {
  function join_next_with_id (line 182) | pub async fn join_next_with_id(&mut self) -> Option<Result<(Id, T), Join...
  function try_poll_handle (line 190) | fn try_poll_handle(jh: &mut AbortOnDropHandle<T>) -> Option<Result<T, Jo...
  function try_join_next (line 207) | pub fn try_join_next(&mut self) -> Option<Result<T, JoinError>> {
  function try_join_next_with_id (line 227) | pub fn try_join_next_with_id(&mut self) -> Option<Result<(Id, T), JoinEr...
  function shutdown (line 249) | pub async fn shutdown(&mut self) {
  function join_all (line 270) | pub async fn join_all(mut self) -> Vec<T> {
  function abort_all (line 287) | pub fn abort_all(&mut self) {
  function detach_all (line 295) | pub fn detach_all(&mut self) {
  function poll_join_next (line 319) | pub fn poll_join_next(&mut self, cx: &mut Context<'_>) -> Poll<Option<Re...
  function poll_join_next_with_id (line 357) | pub fn poll_join_next_with_id(
  function fmt (line 382) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  method default (line 390) | fn default() -> Self {
  function from_iter (line 403) | fn from_iter<I: IntoIterator<Item = F>>(iter: I) -> Self {
  type NotDebug (line 417) | struct NotDebug;
  function is_debug (line 419) | fn is_debug<T: std::fmt::Debug>() {}
  function assert_debug (line 422) | fn assert_debug() {

FILE: tokio-util/src/task/spawn_pinned.rs
  type LocalPoolHandle (line 54) | pub struct LocalPoolHandle {
    method new (line 66) | pub fn new(pool_size: usize) -> LocalPoolHandle {
    method num_threads (line 80) | pub fn num_threads(&self) -> usize {
    method get_task_loads_for_each_worker (line 86) | pub fn get_task_loads_for_each_worker(&self) -> Vec<usize> {
    method spawn_pinned (line 126) | pub fn spawn_pinned<F, Fut>(&self, create_task: F) -> JoinHandle<Fut::...
    method spawn_pinned_by_idx (line 182) | pub fn spawn_pinned_by_idx<F, Fut>(&self, create_task: F, idx: usize) ...
  method fmt (line 195) | fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
  type WorkerChoice (line 200) | enum WorkerChoice {
  type LocalPool (line 205) | struct LocalPool {
    method spawn_pinned (line 212) | fn spawn_pinned<F, Fut>(
    method find_and_incr_least_burdened_worker (line 314) | fn find_and_incr_least_burdened_worker(&self) -> (&LocalWorkerHandle, ...
    method find_worker_by_idx (line 341) | fn find_worker_by_idx(&self, idx: usize) -> (&LocalWorkerHandle, JobCo...
  type JobCountGuard (line 351) | struct JobCountGuard(Arc<AtomicUsize>);
  method drop (line 354) | fn drop(&mut self) {
  type AbortGuard (line 362) | struct AbortGuard(AbortHandle);
  method drop (line 365) | fn drop(&mut self) {
  type PinnedFutureSpawner (line 370) | type PinnedFutureSpawner = Box<dyn FnOnce() + Send + 'static>;
  type LocalWorkerHandle (line 372) | struct LocalWorkerHandle {
    method new_worker (line 380) | fn new_worker() -> LocalWorkerHandle {
    method run (line 399) | fn run(

FILE: tokio-util/src/task/task_tracker.rs
  type TaskTracker (line 158) | pub struct TaskTracker {
    method new (line 293) | pub fn new() -> Self {
    method wait (line 318) | pub fn wait(&self) -> TaskTrackerWaitFuture<'_> {
    method close (line 337) | pub fn close(&self) -> bool {
    method reopen (line 349) | pub fn reopen(&self) -> bool {
    method is_closed (line 356) | pub fn is_closed(&self) -> bool {
    method len (line 363) | pub fn len(&self) -> usize {
    method is_empty (line 370) | pub fn is_empty(&self) -> bool {
    method spawn (line 381) | pub fn spawn<F>(&self, task: F) -> JoinHandle<F::Output>
    method spawn_on (line 396) | pub fn spawn_on<F>(&self, task: F, handle: &Handle) -> JoinHandle<F::O...
    method spawn_local (line 419) | pub fn spawn_local<F>(&self, task: F) -> JoinHandle<F::Output>
    method spawn_local_on (line 436) | pub fn spawn_local_on<F>(&self, task: F, local_set: &LocalSet) -> Join...
    method spawn_blocking (line 452) | pub fn spawn_blocking<F, T>(&self, task: F) -> JoinHandle<T>
    method spawn_blocking_on (line 474) | pub fn spawn_blocking_on<F, T>(&self, task: F, handle: &Handle) -> Joi...
    method track_future (line 532) | pub fn track_future<F: Future>(&self, future: F) -> TrackedFuture<F> {
    method token (line 549) | pub fn token(&self) -> TaskTrackerToken {
    method ptr_eq (line 572) | pub fn ptr_eq(left: &TaskTracker, right: &TaskTracker) -> bool {
    method fmt (line 643) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type TaskTrackerToken (line 165) | pub struct TaskTrackerToken {
    method task_tracker (line 652) | pub fn task_tracker(&self) -> &TaskTracker {
  type TaskTrackerInner (line 169) | struct TaskTrackerInner {
    method new (line 208) | fn new() -> Self {
    method is_closed_and_empty (line 216) | fn is_closed_and_empty(&self) -> bool {
    method set_closed (line 225) | fn set_closed(&self) -> bool {
    method set_open (line 252) | fn set_open(&self) -> bool {
    method add_task (line 259) | fn add_task(&self) {
    method drop_task (line 264) | fn drop_task(&self) {
    method notify_now (line 274) | fn notify_now(&self) {
  method default (line 582) | fn default() -> TaskTracker {
  method clone (line 623) | fn clone(&self) -> TaskTracker {
  function debug_inner (line 630) | fn debug_inner(inner: &TaskTrackerInner, f: &mut fmt::Formatter<'_>) -> ...
  method clone (line 662) | fn clone(&self) -> TaskTrackerToken {
  method drop (line 670) | fn drop(&mut self) {
  type Output (line 676) | type Output = F::Output;
  method poll (line 679) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<F::Output> {
  function fmt (line 685) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Output (line 694) | type Output = ();
  method poll (line 697) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()> {
  function fmt (line 716) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {

FILE: tokio-util/src/time/delay_queue.rs
  type DelayQueue (line 135) | pub struct DelayQueue<T> {
  type SlabStorage (line 162) | struct SlabStorage<T> {
  function with_capacity (line 181) | pub(crate) fn with_capacity(capacity: usize) -> SlabStorage<T> {
  function insert (line 191) | pub(crate) fn insert(&mut self, val: Data<T>) -> Key {
  function remove (line 231) | pub(crate) fn remove(&mut self, key: &Key) -> Data<T> {
  function shrink_to_fit (line 244) | pub(crate) fn shrink_to_fit(&mut self) {
  function compact (line 249) | pub(crate) fn compact(&mut self) {
  function remap_key (line 278) | fn remap_key(&self, key: &Key) -> Option<KeyInternal> {
  function create_new_key (line 287) | fn create_new_key(&mut self) -> KeyInternal {
  function len (line 295) | pub(crate) fn len(&self) -> usize {
  function capacity (line 299) | pub(crate) fn capacity(&self) -> usize {
  function clear (line 303) | pub(crate) fn clear(&mut self) {
  function reserve (line 309) | pub(crate) fn reserve(&mut self, additional: usize) {
  function is_empty (line 317) | pub(crate) fn is_empty(&self) -> bool {
  function contains (line 321) | pub(crate) fn contains(&self, key: &Key) -> bool {
  function fmt (line 335) | fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
  type Output (line 348) | type Output = Data<T>;
  function index (line 350) | fn index(&self, key: Key) -> &Self::Output {
  function index_mut (line 361) | fn index_mut(&mut self, key: Key) -> &mut Data<T> {
  type Expired (line 377) | pub struct Expired<T> {
  type Key (line 396) | pub struct Key {
    method new (line 1306) | pub(crate) fn new(index: usize) -> Key {
    method from (line 1324) | fn from(item: KeyInternal) -> Self {
  type KeyInternal (line 404) | struct KeyInternal {
    method new (line 1312) | pub(crate) fn new(index: usize) -> KeyInternal {
    method from (line 1318) | fn from(item: Key) -> Self {
  type Stack (line 409) | struct Stack<T> {
  type Data (line 416) | struct Data<T> {
  constant MAX_ENTRIES (line 435) | const MAX_ENTRIES: usize = (1 << 30) - 1;
  function new (line 448) | pub fn new() -> DelayQueue<T> {
  function with_capacity (line 477) | pub fn with_capacity(capacity: usize) -> DelayQueue<T> {
  function insert_at (line 538) | pub fn insert_at(&mut self, value: T, when: Instant) -> Key {
  function poll_expired (line 582) | pub fn poll_expired(&mut self, cx: &mut task::Context<'_>) -> Poll<Optio...
  function insert (line 657) | pub fn insert(&mut self, value: T, timeout: Duration) -> Key {
  function insert_idx (line 662) | fn insert_idx(&mut self, when: u64, key: Key) {
  function deadline (line 706) | pub fn deadline(&self, key: &Key) -> Instant {
  function remove_key (line 717) | fn remove_key(&mut self, key: &Key) {
  function remove (line 757) | pub fn remove(&mut self, key: &Key) -> Expired<T> {
  function try_remove (line 814) | pub fn try_remove(&mut self, key: &Key) -> Option<Expired<T>> {
  function reset_at (line 857) | pub fn reset_at(&mut self, key: &Key, when: Instant) {
  function shrink_to_fit (line 884) | pub fn shrink_to_fit(&mut self) {
  function compact (line 915) | pub fn compact(&mut self) {
  function peek (line 948) | pub fn peek(&self) -> Option<Key> {
  function next_deadline (line 957) | fn next_deadline(&self) -> Option<Instant> {
  function reset (line 999) | pub fn reset(&mut self, key: &Key, timeout: Duration) {
  function clear (line 1030) | pub fn clear(&mut self) {
  function capacity (line 1047) | pub fn capacity(&self) -> usize {
  function len (line 1067) | pub fn len(&self) -> usize {
  function reserve (line 1105) | pub fn reserve(&mut self, additional: usize) {
  function is_empty (line 1133) | pub fn is_empty(&self) -> bool {
  function poll_idx (line 1141) | fn poll_idx(&mut self, cx: &mut task::Context<'_>) -> Poll<Option<Key>> {
  function normalize_deadline (line 1176) | fn normalize_deadline(&self, when: Instant) -> u64 {
  method default (line 1191) | fn default() -> DelayQueue<T> {
  type Item (line 1199) | type Item = Expired<T>;
  function poll_next (line 1201) | fn poll_next(self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll<O...
  type Owned (line 1207) | type Owned = Key;
  type Borrowed (line 1208) | type Borrowed = Key;
  type Store (line 1209) | type Store = SlabStorage<T>;
  function is_empty (line 1211) | fn is_empty(&self) -> bool {
  function push (line 1215) | fn push(&mut self, item: Self::Owned, store: &mut Self::Store) {
  function pop (line 1231) | fn pop(&mut self, store: &mut Self::Store) -> Option<Self::Owned> {
  function peek (line 1248) | fn peek(&self) -> Option<Self::Owned> {
  function remove (line 1253) | fn remove(&mut self, item: &Self::Borrowed, store: &mut Self::Store) {
  function when (line 1291) | fn when(item: &Self::Borrowed, store: &Self::Store) -> u64 {
  method default (line 1297) | fn default() -> Stack<T> {
  function get_ref (line 1331) | pub fn get_ref(&self) -> &T {
  function get_mut (line 1336) | pub fn get_mut(&mut self) -> &mut T {
  function into_inner (line 1341) | pub fn into_inner(self) -> T {
  function deadline (line 1346) | pub fn deadline(&self) -> Instant {
  function key (line 1351) | pub fn key(&self) -> Key {

FILE: tokio-util/src/time/mod.rs
  type Round (line 26) | enum Round {
  function ms (line 37) | fn ms(duration: Duration, round: Round) -> u64 {

FILE: tokio-util/src/time/wheel/level.rs
  type Level (line 6) | pub(crate) struct Level<T> {
  type Expiration (line 24) | pub(crate) struct Expiration {
  constant LEVEL_MULT (line 38) | const LEVEL_MULT: usize = 64;
  function new (line 41) | pub(crate) fn new(level: usize) -> Level<T> {
  function next_expiration (line 51) | pub(crate) fn next_expiration(&self, now: u64) -> Option<Expiration> {
  function next_occupied_slot (line 103) | fn next_occupied_slot(&self, now: u64) -> Option<usize> {
  function add_entry (line 117) | pub(crate) fn add_entry(&mut self, when: u64, item: T::Owned, store: &mu...
  function remove_entry (line 124) | pub(crate) fn remove_entry(&mut self, when: u64, item: &T::Borrowed, sto...
  function pop_entry_slot (line 138) | pub(crate) fn pop_entry_slot(&mut self, slot: usize, store: &mut T::Stor...
  function peek_entry_slot (line 151) | pub(crate) fn peek_entry_slot(&self, slot: usize) -> Option<T::Owned> {
  function fmt (line 157) | fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
  function occupied_bit (line 164) | fn occupied_bit(slot: usize) -> u64 {
  function slot_range (line 168) | fn slot_range(level: usize) -> u64 {
  function level_range (line 172) | fn level_range(level: usize) -> u64 {
  function slot_for (line 177) | fn slot_for(duration: u64, level: usize) -> usize {
  function test_slot_for (line 186) | fn test_slot_for() {

FILE: tokio-util/src/time/wheel/mod.rs
  type Wheel (line 25) | pub(crate) struct Wheel<T> {
  constant NUM_LEVELS (line 45) | const NUM_LEVELS: usize = 6;
  constant MAX_DURATION (line 48) | const MAX_DURATION: u64 = (1 << (6 * NUM_LEVELS)) - 1;
  type InsertError (line 51) | pub(crate) enum InsertError {
  function new (line 61) | pub(crate) fn new() -> Wheel<T> {
  function elapsed (line 69) | pub(crate) fn elapsed(&self) -> u64 {
  function insert (line 94) | pub(crate) fn insert(
  function remove (line 123) | pub(crate) fn remove(&mut self, item: &T::Borrowed, store: &mut T::Store) {
  function poll_at (line 139) | pub(crate) fn poll_at(&self) -> Option<u64> {
  function peek (line 144) | pub(crate) fn peek(&self) -> Option<T::Owned> {
  function poll (line 150) | pub(crate) fn poll(&mut self, now: u64, store: &mut T::Store) -> Option<...
  function next_expiration (line 181) | fn next_expiration(&self) -> Option<Expiration> {
  function no_expirations_before (line 197) | fn no_expirations_before(&self, start_level: usize, before: u64) -> bool {
  function poll_expiration (line 215) | pub(crate) fn poll_expiration(
  function set_elapsed (line 237) | fn set_elapsed(&mut self, when: u64) {
  function pop_entry (line 250) | fn pop_entry(&mut self, expiration: &Expiration, store: &mut T::Store) -...
  function peek_entry (line 254) | fn peek_entry(&self, expiration: &Expiration) -> Option<T::Owned> {
  function level_for (line 258) | fn level_for(&self, when: u64) -> usize {
  function level_for (line 263) | fn level_for(elapsed: u64, when: u64) -> usize {
  function test_level_for (line 283) | fn test_level_for() {

FILE: tokio-util/src/time/wheel/stack.rs
  type Stack (line 6) | pub(crate) trait Stack: Default {
    method is_empty (line 17) | fn is_empty(&self) -> bool;
    method push (line 20) | fn push(&mut self, item: Self::Owned, store: &mut Self::Store);
    method pop (line 23) | fn pop(&mut self, store: &mut Self::Store) -> Option<Self::Owned>;
    method peek (line 26) | fn peek(&self) -> Option<Self::Owned>;
    method remove (line 28) | fn remove(&mut self, item: &Self::Borrowed, store: &mut Self::Store);
    method when (line 30) | fn when(item: &Self::Borrowed, store: &Self::Store) -> u64;

FILE: tokio-util/src/udp/frame.rs
  type UdpFramed (line 38) | pub struct UdpFramed<C, T = UdpSocket> {
  constant INITIAL_RD_CAPACITY (line 49) | const INITIAL_RD_CAPACITY: usize = 64 * 1024;
  constant INITIAL_WR_CAPACITY (line 50) | const INITIAL_WR_CAPACITY: usize = 8 * 1024;
  type Item (line 59) | type Item = Result<(C::Item, SocketAddr), C::Error>;
  method poll_next (line 61) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
  type Error (line 113) | type Error = C::Error;
  function poll_ready (line 115) | fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  function start_send (line 126) | fn start_send(self: Pin<&mut Self>, item: (I, SocketAddr)) -> Result<(),...
  function poll_flush (line 138) | fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Re...
  function poll_close (line 169) | fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result...
  function new (line 182) | pub fn new(socket: T, codec: C) -> UdpFramed<C, T> {
  function get_ref (line 202) | pub fn get_ref(&self) -> &T {
  function get_mut (line 213) | pub fn get_mut(&mut self) -> &mut T {
  function codec (line 222) | pub fn codec(&self) -> &C {
  function codec_mut (line 231) | pub fn codec_mut(&mut self) -> &mut C {
  function read_buffer (line 236) | pub fn read_buffer(&self) -> &BytesMut {
  function read_buffer_mut (line 241) | pub fn read_buffer_mut(&mut self) -> &mut BytesMut {
  function into_inner (line 246) | pub fn into_inner(self) -> T {

FILE: tokio-util/src/util/maybe_dangling.rs
  type MaybeDangling (line 28) | pub(crate) struct MaybeDangling<T>(MaybeUninit<T>);
  method drop (line 31) | fn drop(&mut self) {
  function new (line 38) | pub(crate) fn new(inner: T) -> Self {
  type Output (line 44) | type Output = F::Output;
  method poll (line 46) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
  function maybedangling_runs_drop (line 54) | fn maybedangling_runs_drop() {

FILE: tokio-util/src/util/poll_buf.rs
  function poll_read_buf (line 47) | pub fn poll_read_buf<T: AsyncRead + ?Sized, B: BufMut>(
  function poll_write_buf (line 121) | pub fn poll_write_buf<T: AsyncWrite + ?Sized, B: Buf>(

FILE: tokio-util/tests/abort_on_drop.rs
  function aborts_task_on_drop (line 5) | async fn aborts_task_on_drop() {
  function aborts_task_directly (line 17) | async fn aborts_task_directly() {
  function does_not_abort_after_detach (line 30) | async fn does_not_abort_after_detach() {
  function handle_aborts_task_on_drop (line 42) | async fn handle_aborts_task_on_drop() {
  function handle_aborts_task_directly (line 54) | async fn handle_aborts_task_directly() {
  function handle_does_not_abort_after_detach (line 67) | async fn handle_does_not_abort_after_detach() {

FILE: tokio-util/tests/codecs.rs
  function bytes_decoder (line 8) | fn bytes_decoder() {
  function bytes_encoder (line 20) | fn bytes_encoder() {
  function lines_decoder (line 47) | fn lines_decoder() {
  function lines_decoder_invalid_utf8 (line 66) | fn lines_decoder_invalid_utf8() {
  function lines_decoder_max_length (line 79) | fn lines_decoder_max_length() {
  function lines_decoder_max_length_underrun (line 123) | fn lines_decoder_max_length_underrun() {
  function lines_decoder_max_length_bursts (line 144) | fn lines_decoder_max_length_bursts() {
  function lines_decoder_max_length_big_burst (line 160) | fn lines_decoder_max_length_big_burst() {
  function lines_decoder_max_length_newline_between_decodes (line 174) | fn lines_decoder_max_length_newline_between_decodes() {
  function lines_decoder_discard_repeat (line 190) | fn lines_decoder_discard_repeat() {
  function lines_decoder_max_length_underrun_twice (line 205) | fn lines_decoder_max_length_underrun_twice() {
  function lines_encoder (line 223) | fn lines_encoder() {
  function any_delimiters_decoder_any_character (line 235) | fn any_delimiters_decoder_any_character() {
  function any_delimiters_decoder_max_length (line 254) | fn any_delimiters_decoder_max_length() {
  function any_delimiter_decoder_max_length_underrun (line 331) | fn any_delimiter_decoder_max_length_underrun() {
  function any_delimiter_decoder_max_length_underrun_twice (line 353) | fn any_delimiter_decoder_max_length_underrun_twice() {
  function any_delimiter_decoder_max_length_bursts (line 371) | fn any_delimiter_decoder_max_length_bursts() {
  function any_delimiter_decoder_max_length_big_burst (line 388) | fn any_delimiter_decoder_max_length_big_burst() {
  function any_delimiter_decoder_max_length_delimiter_between_decodes (line 403) | fn any_delimiter_decoder_max_length_delimiter_between_decodes() {
  function any_delimiter_decoder_discard_repeat (line 419) | fn any_delimiter_decoder_discard_repeat() {
  function any_delimiter_encoder (line 434) | fn any_delimiter_encoder() {

FILE: tokio-util/tests/compat.rs
  function compat_file_seek (line 12) | async fn compat_file_seek() -> futures_util::io::Result<()> {

FILE: tokio-util/tests/context.rs
  function tokio_context_with_another_runtime (line 10) | fn tokio_context_with_another_runtime() {

FILE: tokio-util/tests/framed.rs
  constant INITIAL_CAPACITY (line 12) | const INITIAL_CAPACITY: usize = 8 * 1024;
  type U32Codec (line 16) | struct U32Codec {
    type Error (line 36) | type Error = io::Error;
    method encode (line 38) | fn encode(&mut self, item: u32, dst: &mut BytesMut) -> io::Result<()> {
  type Item (line 21) | type Item = u32;
  type Error (line 22) | type Error = io::Error;
  method decode (line 24) | fn decode(&mut self, buf: &mut BytesMut) -> io::Result<Option<u32>> {
  type U64Codec (line 48) | struct U64Codec {
    type Error (line 68) | type Error = io::Error;
    method encode (line 70) | fn encode(&mut self, item: u64, dst: &mut BytesMut) -> io::Result<()> {
  type Item (line 53) | type Item = u64;
  type Error (line 54) | type Error = io::Error;
  method decode (line 56) | fn decode(&mut self, buf: &mut BytesMut) -> io::Result<Option<u64>> {
  type DontReadIntoThis (line 79) | struct DontReadIntoThis;
    method poll_read (line 91) | fn poll_read(
  method read (line 82) | fn read(&mut self, _: &mut [u8]) -> io::Result<usize> {
  function can_read_from_existing_buf (line 101) | async fn can_read_from_existing_buf() {
  function can_read_from_existing_buf_after_codec_changed (line 113) | async fn can_read_from_existing_buf_after_codec_changed() {
  function external_buf_grows_to_init (line 133) | fn external_buf_grows_to_init() {
  function from_parts_empty_read_buf_does_not_spuriously_decode (line 151) | async fn from_parts_empty_read_buf_does_not_spuriously_decode() {
  function external_buf_does_not_shrink (line 197) | fn external_buf_does_not_shrink() {

FILE: tokio-util/tests/framed_read.rs
  type U32Decoder (line 37) | struct U32Decoder;
  type Item (line 40) | type Item = u32;
  type Error (line 41) | type Error = io::Error;
  method decode (line 43) | fn decode(&mut self, buf: &mut BytesMut) -> io::Result<Option<u32>> {
  type U64Decoder (line 53) | struct U64Decoder;
  type Item (line 56) | type Item = u64;
  type Error (line 57) | type Error = io::Error;
  method decode (line 59) | fn decode(&mut self, buf: &mut BytesMut) -> io::Result<Option<u64>> {
  function read_multi_frame_in_packet (line 70) | fn read_multi_frame_in_packet() {
  function read_multi_frame_across_packets (line 86) | fn read_multi_frame_across_packets() {
  function read_multi_frame_in_packet_after_codec_changed (line 104) | fn read_multi_frame_in_packet_after_codec_changed() {
  function read_not_ready (line 122) | fn read_not_ready() {
  function read_partial_then_not_ready (line 140) | fn read_partial_then_not_ready() {
  function read_err (line 159) | fn read_err() {
  function read_partial_then_err (line 178) | fn read_partial_then_err() {
  function read_partial_would_block_then_err (line 198) | fn read_partial_would_block_then_err() {
  function huge_size (line 220) | fn huge_size() {
  function data_remaining_is_error (line 247) | fn data_remaining_is_error() {
  function multi_frames_on_eof (line 259) | fn multi_frames_on_eof() {
  function read_eof_then_resume (line 292) | fn read_eof_then_resume() {
  type Mock (line 316) | struct Mock {
  method poll_read (line 321) | fn poll_read(

FILE: tokio-util/tests/framed_stream.rs
  function return_none_after_error (line 20) | async fn return_none_after_error() {

FILE: tokio-util/tests/framed_write.rs
  type U32Encoder (line 29) | struct U32Encoder;
    type Error (line 32) | type Error = io::Error;
    method encode (line 34) | fn encode(&mut self, item: u32, dst: &mut BytesMut) -> io::Result<()> {
  type U64Encoder (line 42) | struct U64Encoder;
    type Error (line 45) | type Error = io::Error;
    method encode (line 47) | fn encode(&mut self, item: u64, dst: &mut BytesMut) -> io::Result<()> {
  function write_multi_frame_in_packet (line 56) | fn write_multi_frame_in_packet() {
  function write_multi_frame_after_codec_changed (line 82) | fn write_multi_frame_after_codec_changed() {
  function write_hits_backpressure (line 108) | fn write_hits_backpressure() {
  type Mock (line 170) | struct Mock {
  method write (line 175) | fn write(&mut self, src: &[u8]) -> io::Result<usize> {
  method flush (line 187) | fn flush(&mut self) -> io::Result<()> {
  method poll_write (line 193) | fn poll_write(
  method poll_flush (line 203) | fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Resul...
  method poll_shutdown (line 209) | fn poll_shutdown(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Re...

FILE: tokio-util/tests/future.rs
  type ReadyOnTheSecondPollFuture (line 12) | struct ReadyOnTheSecondPollFuture {
  type Output (line 17) | type Output = ();
  method poll (line 19) | fn poll(mut self: std::pin::Pin<&mut Self>, _cx: &mut Context<'_>) -> Po...
  function ready_fut_with_cancellation_token_test (line 29) | fn ready_fut_with_cancellation_token_test() {
  function pending_fut_with_cancellation_token_test (line 47) | fn pending_fut_with_cancellation_token_test() {
  function ready_fut_with_already_cancelled_token_test (line 65) | fn ready_fut_with_already_cancelled_token_test() {
  function pending_fut_with_already_cancelled_token_test (line 84) | fn pending_fut_with_already_cancelled_token_test() {
  function pending_fut_with_token_cancelled_test (line 104) | fn pending_fut_with_token_cancelled_test() {
  function pending_only_on_first_poll_with_cancellation_token_test (line 129) | fn pending_only_on_first_poll_with_cancellation_token_test() {
  function ready_fut_with_cancellation_owned_token_test (line 150) | fn ready_fut_with_cancellation_owned_token_test() {
  function pending_fut_with_cancellation_token_owned_test (line 168) | fn pending_fut_with_cancellation_token_owned_test() {
  function ready_fut_with_already_cancelled_token_owned_test (line 186) | fn ready_fut_with_already_cancelled_token_owned_test() {
  function pending_fut_with_already_cancelled_token_owned_test (line 205) | fn pending_fut_with_already_cancelled_token_owned_test() {
  function pending_fut_with_owned_token_cancelled_test (line 225) | fn pending_fut_with_owned_token_cancelled_test() {
  function pending_only_on_first_poll_with_cancellation_token_owned_test (line 250) | fn pending_only_on_first_poll_with_cancellation_token_owned_test() {

FILE: tokio-util/tests/io_inspect.rs
  type SmallReader (line 12) | struct SmallReader {
  method poll_read (line 19) | fn poll_read(
  function read_tee (line 32) | async fn read_tee() {
  type SmallWriter (line 53) | struct SmallWriter {
  method poll_write (line 60) | fn poll_write(
  method poll_flush (line 73) | fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Resul...
  method poll_shutdown (line 77) | fn poll_shutdown(
  method poll_write_vectored (line 84) | fn poll_write_vectored(
  method is_write_vectored (line 108) | fn is_write_vectored(&self) -> bool {
  function write_tee (line 114) | async fn write_tee() {
  function write_all_vectored (line 132) | async fn write_all_vectored<W: AsyncWrite + Unpin>(
  function write_tee_vectored (line 161) | async fn write_tee_vectored() {

FILE: tokio-util/tests/io_reader_stream.rs
  type Reader (line 10) | struct Reader {
  method poll_read (line 15) | fn poll_read(
  function correct_behavior_on_errors (line 38) | async fn correct_behavior_on_errors() {

FILE: tokio-util/tests/io_simplex.rs
  function single_thread (line 12) | async fn single_thread() {
  function multi_thread (line 46) | fn multi_thread() {
  function zero_capacity (line 85) | fn zero_capacity() {
  function read_buf_is_full (line 92) | async fn read_buf_is_full() {
  function write_buf_is_empty (line 103) | async fn write_buf_is_empty() {
  function drop_receiver_0 (line 112) | async fn drop_receiver_0() {
  function drop_receiver_1 (line 121) | async fn drop_receiver_1() {
  function drop_sender_0 (line 136) | async fn drop_sender_0() {
  function drop_sender_1 (line 151) | async fn drop_sender_1() {
  function shutdown_sender_0 (line 171) | async fn shutdown_sender_0() {
  function shutdown_sender_1 (line 184) | async fn shutdown_sender_1() {
  function shutdown_sender_2 (line 192) | async fn shutdown_sender_2() {
  function cooperative_scheduling (line 214) | async fn cooperative_scheduling() {
  function poll_write_vectored_0 (line 276) | async fn poll_write_vectored_0() {
  function poll_write_vectored_1 (line 297) | async fn poll_write_vectored_1() {
  function poll_write_vectored_2 (line 320) | async fn poll_write_vectored_2() {
  function poll_write_vectored_3 (line 350) | async fn poll_write_vectored_3() {

FILE: tokio-util/tests/io_sink_writer.rs
  function test_copied_sink_writer (line 12) | async fn test_copied_sink_writer() -> Result<(), Error> {
  type SliceEncoder (line 34) | struct SliceEncoder;
    method new (line 37) | fn new() -> Self {
    type Error (line 43) | type Error = Error;
    method encode (line 45) | fn encode(&mut self, item: &'a [u8], dst: &mut bytes::BytesMut) -> Res...
  function test_direct_sink_writer (line 55) | async fn test_direct_sink_writer() -> Result<(), Error> {

FILE: tokio-util/tests/io_stream_reader.rs
  function test_stream_reader (line 9) | async fn test_stream_reader() -> std::io::Result<()> {

FILE: tokio-util/tests/io_sync_bridge.rs
  function test_reader_len (line 9) | async fn test_reader_len(
  function test_async_read_to_sync (line 25) | async fn test_async_read_to_sync() -> Result<(), Box<dyn Error>> {
  function test_async_write_to_sync (line 33) | async fn test_async_write_to_sync() -> Result<(), Box<dyn Error>> {
  function test_into_inner (line 47) | async fn test_into_inner() -> Result<(), Box<dyn Error>> {
  function test_shutdown (line 59) | async fn test_shutdown() -> Result<(), Box<dyn Error>> {

FILE: tokio-util/tests/io_write_all_vectored.rs
  function test_write_all_vectored (line 14) | async fn test_write_all_vectored() {
  function write_all_vectored_with_empty_slice (line 66) | async fn write_all_vectored_with_empty_slice() {

FILE: tokio-util/tests/length_delimited.rs
  function read_empty_io_yields_nothing (line 74) | fn read_empty_io_yields_nothing() {
  function read_single_frame_one_packet (line 82) | fn read_single_frame_one_packet() {
  function read_single_frame_one_packet_little_endian (line 96) | fn read_single_frame_one_packet_little_endian() {
  function read_single_frame_one_packet_native_endian (line 109) | fn read_single_frame_one_packet_native_endian() {
  function read_single_multi_frame_one_packet (line 127) | fn read_single_multi_frame_one_packet() {
  function read_single_frame_multi_packet (line 148) | fn read_single_frame_multi_packet() {
  function read_multi_frame_multi_packet (line 164) | fn read_multi_frame_multi_packet() {
  function read_single_frame_multi_packet_wait (line 184) | fn read_single_frame_multi_packet_wait() {
  function read_multi_frame_multi_packet_wait (line 206) | fn read_multi_frame_multi_packet_wait() {
  function read_incomplete_head (line 236) | fn read_incomplete_head() {
  function read_incomplete_head_multi (line 249) | fn read_incomplete_head_multi() {
  function read_incomplete_payload (line 266) | fn read_incomplete_payload() {
  function read_max_frame_len (line 284) | fn read_max_frame_len() {
  function read_update_max_frame_len_at_rest (line 296) | fn read_update_max_frame_len_at_rest() {
  function read_update_max_frame_len_in_flight (line 309) | fn read_update_max_frame_len_in_flight() {
  function read_one_byte_length_field (line 325) | fn read_one_byte_length_field() {
  function read_header_offset (line 338) | fn read_header_offset() {
  function read_single_multi_frame_one_packet_skip_none_adjusted (line 352) | fn read_single_multi_frame_one_packet_skip_none_adjusted() {
  function read_single_frame_length_adjusted (line 375) | fn read_single_frame_length_adjusted() {
  function read_single_multi_frame_one_packet_length_includes_head (line 394) | fn read_single_multi_frame_one_packet_length_includes_head() {
  function write_single_frame_length_adjusted (line 415) | fn write_single_frame_length_adjusted() {
  function write_nothing_yields_nothing (line 434) | fn write_nothing_yields_nothing() {
  function write_single_frame_one_packet (line 444) | fn write_single_frame_one_packet() {
  function write_single_multi_frame_one_packet (line 464) | fn write_single_multi_frame_one_packet() {
  function write_single_multi_frame_multi_packet (line 495) | fn write_single_multi_frame_multi_packet() {
  function write_single_frame_would_block (line 532) | fn write_single_frame_would_block() {
  function write_single_frame_little_endian (line 559) | fn write_single_frame_little_endian() {
  function write_single_frame_with_short_length_field (line 579) | fn write_single_frame_with_short_length_field() {
  function write_max_frame_len (line 600) | fn write_max_frame_len() {
  function write_update_max_frame_len_at_rest (line 615) | fn write_update_max_frame_len_at_rest() {
  function write_update_max_frame_len_in_flight (line 638) | fn write_update_max_frame_len_in_flight() {
  function write_zero (line 664) | fn write_zero() {
  function encode_overflow (line 679) | fn encode_overflow() {
  function frame_does_not_fit (line 693) | fn frame_does_not_fit() {
  function neg_adjusted_frame_does_not_fit (line 703) | fn neg_adjusted_frame_does_not_fit() {
  function pos_adjusted_frame_does_not_fit (line 713) | fn pos_adjusted_frame_does_not_fit() {
  function max_allowed_frame_fits (line 723) | fn max_allowed_frame_fits() {
  function smaller_frame_len_not_adjusted (line 733) | fn smaller_frame_len_not_adjusted() {
  function max_allowed_length_field (line 743) | fn max_allowed_length_field() {
  type Mock (line 754) | struct Mock {
  type Op (line 758) | enum Op {
    method from (line 819) | fn from(src: &'a [u8]) -> Op {
    method from (line 825) | fn from(src: Vec<u8>) -> Op {
  method poll_read (line 764) | fn poll_read(
  method poll_write (line 784) | fn poll_write(
  method poll_flush (line 803) | fn poll_flush(mut self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<R...
  method poll_shutdown (line 813) | fn poll_shutdown(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Re...
  function data (line 830) | fn data(bytes: &[u8]) -> Poll<io::Result<Op>> {
  function flush (line 834) | fn flush() -> Poll<io::Result<Op>> {

FILE: tokio-util/tests/mpsc.rs
  function simple (line 11) | async fn simple() {
  function simple_ref (line 34) | async fn simple_ref() {
  function repeated_poll_reserve (line 57) | async fn repeated_poll_reserve() {
  function abort_send (line 70) | async fn abort_send() {
  function close_sender_last (line 99) | async fn close_sender_last() {
  function close_sender_not_last (line 113) | async fn close_sender_not_last() {
  function close_sender_before_reserve (line 133) | async fn close_sender_before_reserve() {
  function close_sender_after_pending_reserve (line 150) | async fn close_sender_after_pending_reserve() {
  function close_sender_after_successful_reserve (line 175) | async fn close_sender_after_successful_reserve() {
  function abort_send_after_pending_reserve (line 196) | async fn abort_send_after_pending_reserve() {
  function abort_send_after_successful_reserve (line 218) | async fn abort_send_after_successful_reserve() {
  function closed_when_receiver_drops (line 235) | async fn closed_when_receiver_drops() {
  function start_send_panics_when_idle (line 245) | fn start_send_panics_when_idle() {
  function start_send_panics_when_acquiring (line 254) | fn start_send_panics_when_acquiring() {
  function sink_send_then_flush (line 268) | fn sink_send_then_flush() {
  function sink_send_then_close (line 295) | fn sink_send_then_close() {
  function sink_send_ref (line 332) | fn sink_send_ref() {

FILE: tokio-util/tests/panic.rs
  constant MAX_DURATION_MS (line 19) | const MAX_DURATION_MS: u64 = (1 << (36)) - 1;
  function test_panic (line 21) | fn test_panic<Func: FnOnce() + panic::UnwindSafe>(func: Func) -> Option<...
  function sync_bridge_new_panic_caller (line 53) | fn sync_bridge_new_panic_caller() -> Result<(), Box<dyn Error>> {
  function poll_sender_send_item_panic_caller (line 65) | fn poll_sender_send_item_panic_caller() -> Result<(), Box<dyn Error>> {
  function local_pool_handle_new_panic_caller (line 80) | fn local_pool_handle_new_panic_caller() -> Result<(), Box<dyn Error>> {
  function local_pool_handle_spawn_pinned_by_idx_panic_caller (line 92) | fn local_pool_handle_spawn_pinned_by_idx_panic_caller() -> Result<(), Bo...
  function delay_queue_insert_at_panic_caller (line 108) | fn delay_queue_insert_at_panic_caller() -> Result<(), Box<dyn Error>> {
  function delay_queue_insert_panic_caller (line 129) | fn delay_queue_insert_panic_caller() -> Result<(), Box<dyn Error>> {
  function delay_queue_remove_panic_caller (line 146) | fn delay_queue_remove_panic_caller() -> Result<(), Box<dyn Error>> {
  function delay_queue_reset_at_panic_caller (line 165) | fn delay_queue_reset_at_panic_caller() -> Result<(), Box<dyn Error>> {
  function delay_queue_reset_panic_caller (line 186) | fn delay_queue_reset_panic_caller() -> Result<(), Box<dyn Error>> {
  function delay_queue_reserve_panic_caller (line 204) | fn delay_queue_reserve_panic_caller() -> Result<(), Box<dyn Error>> {
  function future_ext_to_panic_caller (line 221) | fn future_ext_to_panic_caller() -> Result<(), Box<dyn Error>> {
  function basic (line 237) | fn basic() -> Runtime {

FILE: tokio-util/tests/poll_semaphore.rs
  type SemRet (line 7) | type SemRet = Option<OwnedSemaphorePermit>;
  function semaphore_poll (line 9) | fn semaphore_poll(
  function semaphore_poll_many (line 16) | fn semaphore_poll_many(
  function it_works (line 25) | async fn it_works() {
  function can_acquire_many_permits (line 47) | async fn can_acquire_many_permits() {
  function can_poll_different_amounts_of_permits (line 72) | async fn can_poll_different_amounts_of_permits() {

FILE: tokio-util/tests/reusable_box.rs
  function traits (line 13) | fn traits<'a>() {
  function test_different_futures (line 22) | fn test_different_futures() {
  function test_different_sizes (line 43) | fn test_different_sizes() {
  type ZeroSizedFuture (line 61) | struct ZeroSizedFuture {}
  type Output (line 63) | type Output = u32;
  method poll (line 64) | fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<u32> {
  function test_zero_sized (line 70) | fn test_zero_sized() {

FILE: tokio-util/tests/spawn_pinned.rs
  function can_spawn_not_send_future (line 11) | async fn can_spawn_not_send_future() {
  function can_drop_future_and_still_get_output (line 30) | fn can_drop_future_and_still_get_output() {
  function cannot_create_zero_sized_pool (line 49) | fn cannot_create_zero_sized_pool() {
  function can_spawn_multiple_futures (line 55) | async fn can_spawn_multiple_futures() {
  function task_panic_propagates (line 75) | async fn task_panic_propagates() {
  function callback_panic_does_not_kill_worker (line 100) | async fn callback_panic_does_not_kill_worker() {
  function task_cancellation_propagates (line 126) | async fn task_cancellation_propagates() {
  function tasks_are_balanced (line 163) | async fn tasks_are_balanced() {
  function spawn_by_idx (line 200) | async fn spawn_by_idx() {

FILE: tokio-util/tests/sync_cancellation_token.rs
  function cancel_token (line 12) | fn cancel_token() {
  function cancel_token_owned (line 44) | fn cancel_token_owned() {
  function cancel_token_owned_drop_test (line 76) | fn cancel_token_owned_drop_test() {
  function cancel_child_token_through_parent (line 94) | fn cancel_child_token_through_parent() {
  function cancel_grandchild_token_through_parent_if_child_was_dropped (line 132) | fn cancel_grandchild_token_through_parent_if_child_was_dropped() {
  function cancel_child_token_without_parent (line 172) | fn cancel_child_token_without_parent() {
  function create_child_token_after_parent_was_cancelled (line 236) | fn create_child_token_after_parent_was_cancelled() {
  function drop_multiple_child_tokens (line 273) | fn drop_multiple_child_tokens() {
  function cancel_only_all_descendants (line 298) | fn cancel_only_all_descendants() {
  function drop_parent_before_child_tokens (line 426) | fn drop_parent_before_child_tokens() {
  function derives_send_sync (line 439) | fn derives_send_sync() {
  function run_until_cancelled_test (line 451) | fn run_until_cancelled_test() {
  function run_until_cancelled_owned_test (line 513) | fn run_until_cancelled_owned_test() {

FILE: tokio-util/tests/task_join_map.rs
  function rt (line 12) | fn rt() -> tokio::runtime::Runtime {
  function spawn_index_tasks (line 19) | fn spawn_index_tasks(map: &mut JoinMap<usize, usize>, n: usize, on: Opti...
  function spawn_pending_tasks (line 32) | fn spawn_pending_tasks(
  function drain_joinmap_and_assert (line 54) | async fn drain_joinmap_and_assert(mut map: JoinMap<usize, usize>, n: usi...
  function await_receivers_and_assert (line 67) | async fn await_receivers_and_assert(receivers: Vec<oneshot::Receiver<()>...
  function test_with_sleep (line 77) | async fn test_with_sleep() {
  function test_abort_on_drop (line 129) | async fn test_abort_on_drop() {
  function alternating (line 154) | async fn alternating() {
  function test_keys (line 173) | async fn test_keys() {
  function abort_by_key (line 197) | async fn abort_by_key() {
  function abort_by_predicate (line 235) | async fn abort_by_predicate() {
  function runtime_gone (line 269) | fn runtime_gone() {
  function join_map_coop (line 285) | async fn join_map_coop() {
  function abort_all (line 327) | async fn abort_all() {
  function duplicate_keys (line 362) | async fn duplicate_keys() {
  function duplicate_keys2 (line 377) | async fn duplicate_keys2() {
  function duplicate_keys_drop (line 409) | async fn duplicate_keys_drop() {
  function panic_outside_any_runtime (line 445) | fn panic_outside_any_runtime() {
  function panic_in_multi_thread_runtime (line 454) | async fn panic_in_multi_thread_runtime() {
  function spawn_then_join_next (line 465) | async fn spawn_then_join_next() {
  function spawn_then_shutdown (line 477) | async fn spawn_then_shutdown() {
  function spawn_then_drop (line 493) | async fn spawn_then_drop() {
  function spawn_then_join_next (line 512) | async fn spawn_then_join_next() {
  function spawn_then_shutdown (line 527) | async fn spawn_then_shutdown() {
  function spawn_then_drop (line 548) | async fn spawn_then_drop() {
  function spawn_then_join_next (line 577) | async fn spawn_then_join_next() {
  function spawn_then_join_next (line 599) | async fn spawn_then_join_next() {
  function spawn_then_shutdown (line 616) | async fn spawn_then_shutdown() {
  function spawn_then_drop (line 637) | async fn spawn_then_drop() {

FILE: tokio-util/tests/task_join_queue.rs
  function test_join_queue_no_spurious_wakeups (line 10) | async fn test_join_queue_no_spurious_wakeups() {
  function test_join_queue_abort_on_drop (line 34) | async fn test_join_queue_abort_on_drop() {
  function test_join_queue_alternating (line 59) | async fn test_join_queue_alternating() {
  function test_join_queue_abort_all (line 78) | async fn test_join_queue_abort_all() {
  function test_join_queue_join_all (line 110) | async fn test_join_queue_join_all() {
  function test_join_queue_shutdown (line 130) | async fn test_join_queue_shutdown() {
  function test_join_queue_with_manual_abort (line 150) | async fn test_join_queue_with_manual_abort() {
  function test_join_queue_join_next_with_id (line 190) | async fn test_join_queue_join_next_with_id() {
  function test_join_queue_try_join_next (line 226) | async fn test_join_queue_try_join_next() {
  function test_join_queue_try_join_next_disabled_coop (line 280) | async fn test_join_queue_try_join_next_disabled_coop() {
  function test_join_queue_try_join_next_with_id_disabled_coop (line 316) | async fn test_join_queue_try_join_next_with_id_disabled_coop() {
  function spawn_local_panic_outside_any_runtime (line 367) | fn spawn_local_panic_outside_any_runtime() {
  function spawn_local_panic_in_multi_thread_runtime (line 376) | async fn spawn_local_panic_in_multi_thread_runtime() {

FILE: tokio-util/tests/task_tracker.rs
  function open_close (line 12) | fn open_close() {
  function token_len (line 41) | fn token_len() {
  function notify_immediately (line 60) | fn notify_immediately() {
  function notify_immediately_on_reopen (line 69) | fn notify_immediately_on_reopen() {
  function notify_on_close (line 79) | fn notify_on_close() {
  function notify_on_close_reopen (line 90) | fn notify_on_close_reopen() {
  function notify_on_last_task (line 102) | fn notify_on_last_task() {
  function notify_on_last_task_respawn (line 114) | fn notify_on_last_task_respawn() {
  function no_notify_on_respawn_if_open (line 128) | fn no_notify_on_respawn_if_open() {
  function close_during_exit (line 141) | fn close_during_exit() {
  function notify_many (line 169) | fn notify_many() {
  function spawn_then_close (line 191) | async fn spawn_then_close() {
  function panic_outside_any_runtime (line 220) | fn panic_outside_any_runtime() {
  function panic_in_multi_thread_runtime (line 229) | async fn panic_in_multi_thread_runtime() {
  function spawn_then_close (line 236) | async fn spawn_then_close() {
  function spawn_after_close (line 257) | async fn spawn_after_close() {
  function spawn_then_close (line 287) | async fn spawn_then_close() {
  function spawn_then_drop (line 321) | async fn spawn_then_drop() {
  function close_then_spawn (line 354) | async fn close_then_spawn() {

FILE: tokio-util/tests/time_delay_queue.rs
  function single_immediate_delay (line 26) | async fn single_immediate_delay() {
  function multi_immediate_delays (line 42) | async fn multi_immediate_delays() {
  function single_short_delay (line 71) | async fn single_short_delay() {
  function multi_delay_at_start (line 96) | async fn multi_delay_at_start() {
  function insert_in_past_fires_immediately (line 138) | async fn insert_in_past_fires_immediately() {
  function remove_entry (line 154) | async fn remove_entry() {
  function reset_entry (line 173) | async fn reset_entry() {
  function reset_much_later (line 207) | async fn reset_much_later() {
  function reset_twice (line 229) | async fn reset_twice() {
  function repeatedly_reset_entry_inserted_as_expired (line 260) | async fn repeatedly_reset_entry_inserted_as_expired() {
  function remove_expired_item (line 288) | async fn remove_expired_item() {
  function remove_at_timer_wheel_threshold (line 308) | async fn remove_at_timer_wheel_threshold() {
  function expires_before_last_insert (line 336) | async fn expires_before_last_insert() {
  function multi_reset (line 362) | async fn multi_reset() {
  function expire_first_key_when_reset_to_expire_earlier (line 399) | async fn expire_first_key_when_reset_to_expire_earlier() {
  function expire_second_key_when_reset_to_expire_earlier (line 422) | async fn expire_second_key_when_reset_to_expire_earlier() {
  function reset_first_expiring_item_to_expire_later (line 445) | async fn reset_first_expiring_item_to_expire_later() {
  function insert_before_first_after_poll (line 467) | async fn insert_before_first_after_poll() {
  function insert_after_ready_poll (line 493) | async fn insert_after_ready_poll() {
  function reset_later_after_slot_starts (line 526) | async fn reset_later_after_slot_starts() {
  function reset_inserted_expired (line 563) | async fn reset_inserted_expired() {
  function reset_earlier_after_slot_starts (line 588) | async fn reset_earlier_after_slot_starts() {
  function insert_in_past_after_poll_fires_immediately (line 625) | async fn insert_in_past_after_poll_fires_immediately() {
  function delay_queue_poll_expired_when_empty (line 648) | async fn delay_queue_poll_expired_when_empty() {
  function compact_expire_empty (line 658) | async fn compact_expire_empty() {
  function compact_remove_empty (line 681) | async fn compact_remove_empty() {
  function compact_remove_remapped_keys (line 701) | async fn compact_remove_remapped_keys() {
  function compact_change_deadline (line 740) | async fn compact_change_deadline() {
  function item_expiry_greater_than_wheel (line 792) | async fn item_expiry_greater_than_wheel() {
  function remove_after_compact (line 810) | async fn remove_after_compact() {
  function remove_after_compact_poll (line 828) | async fn remove_after_compact_poll() {
  function peek (line 847) | async fn peek() {
  function wake_after_remove_last (line 885) | async fn wake_after_remove_last() {
  function ms (line 897) | fn ms(n: u64) -> Duration {

FILE: tokio-util/tests/udp.rs
  function send_framed_byte_codec (line 29) | async fn send_framed_byte_codec() -> std::io::Result<()> {
  type ByteCodec (line 81) | pub struct ByteCodec;
    type Error (line 94) | type Error = io::Error;
    method encode (line 96) | fn encode(&mut self, data: &[u8], buf: &mut BytesMut) -> Result<(), io...
  type Item (line 84) | type Item = Vec<u8>;
  type Error (line 85) | type Error = io::Error;
  method decode (line 87) | fn decode(&mut self, buf: &mut BytesMut) -> Result<Option<Vec<u8>>, io::...
  function send_framed_lines_codec (line 104) | async fn send_framed_lines_codec() -> std::io::Result<()> {
  function framed_half (line 125) | async fn framed_half() -> std::io::Result<()> {

FILE: tokio/src/doc/mod.rs
  type NotDefinedHere (line 21) | pub enum NotDefinedHere {}
    method register (line 25) | fn register(
    method reregister (line 33) | fn reregister(
    method deregister (line 41) | fn deregister(&mut self, _registry: &mio::Registry) -> std::io::Result...

FILE: tokio/src/doc/os.rs
  type RawHandle (line 12) | pub type RawHandle = crate::doc::NotDefinedHere;
  type OwnedHandle (line 15) | pub type OwnedHandle = crate::doc::NotDefinedHere;
  type AsRawHandle (line 18) | pub trait AsRawHandle {
    method as_raw_handle (line 20) | fn as_raw_handle(&self) -> RawHandle;
  type FromRawHandle (line 24) | pub trait FromRawHandle {
    method from_raw_handle (line 26) | unsafe fn from_raw_handle(handle: RawHandle) -> Self;
  type RawSocket (line 30) | pub type RawSocket = crate::doc::NotDefinedHere;
  type AsRawSocket (line 33) | pub trait AsRawSocket {
    method as_raw_socket (line 35) | fn as_raw_socket(&self) -> RawSocket;
  type FromRawSocket (line 39) | pub trait FromRawSocket {
    method from_raw_socket (line 41) | unsafe fn from_raw_socket(sock: RawSocket) -> Self;
  type IntoRawSocket (line 45) | pub trait IntoRawSocket {
    method into_raw_socket (line 47) | fn into_raw_socket(self) -> RawSocket;
  type BorrowedHandle (line 51) | pub type BorrowedHandle<'handle> = crate::doc::NotDefinedHere;
  type AsHandle (line 54) | pub trait AsHandle {
    method as_handle (line 56) | fn as_handle(&self) -> BorrowedHandle<'_>;
  type BorrowedSocket (line 60) | pub type BorrowedSocket<'socket> = crate::doc::NotDefinedHere;
  type AsSocket (line 63) | pub trait AsSocket {
    method as_socket (line 65) | fn as_socket(&self) -> BorrowedSocket<'_>;

FILE: tokio/src/fs/canonicalize.rs
  function canonicalize (line 46) | pub async fn canonicalize(path: impl AsRef<Path>) -> io::Result<PathBuf> {

FILE: tokio/src/fs/copy.rs
  function copy (line 20) | pub async fn copy(from: impl AsRef<Path>, to: impl AsRef<Path>) -> Resul...

FILE: tokio/src/fs/create_dir.rs
  function create_dir (line 47) | pub async fn create_dir(path: impl AsRef<Path>) -> io::Result<()> {

FILE: tokio/src/fs/create_dir_all.rs
  function create_dir_all (line 48) | pub async fn create_dir_all(path: impl AsRef<Path>) -> io::Result<()> {

FILE: tokio/src/fs/dir_builder.rs
  type DirBuilder (line 11) | pub struct DirBuilder {
    method new (line 33) | pub fn new() -> Self {
    method recursive (line 52) | pub fn recursive(&mut self, recursive: bool) -> &mut Self {
    method create (line 91) | pub async fn create(&self, path: impl AsRef<Path>) -> io::Result<()> {

FILE: tokio/src/fs/file.rs
  type File (line 90) | pub struct File {
    method open (line 152) | pub async fn open(path: impl AsRef<Path>) -> io::Result<File> {
    method create (line 187) | pub async fn create(path: impl AsRef<Path>) -> io::Result<File> {
    method create_new (line 227) | pub async fn create_new<P: AsRef<Path>>(path: P) -> std::io::Result<Fi...
    method options (line 263) | pub fn options() -> OpenOptions {
    method from_std (line 277) | pub fn from_std(std: StdFile) -> File {
    method sync_all (line 312) | pub async fn sync_all(&self) -> io::Result<()> {
    method sync_data (line 347) | pub async fn sync_data(&self) -> io::Result<()> {
    method set_len (line 385) | pub async fn set_len(&self, size: u64) -> io::Result<()> {
    method metadata (line 444) | pub async fn metadata(&self) -> io::Result<Metadata> {
    method try_clone (line 464) | pub async fn try_clone(&self) -> io::Result<File> {
    method into_std (line 489) | pub async fn into_std(mut self) -> StdFile {
    method try_into_std (line 513) | pub fn try_into_std(mut self) -> Result<StdFile, Self> {
    method set_permissions (line 552) | pub async fn set_permissions(&self, perm: Permissions) -> io::Result<(...
    method set_max_buf_size (line 581) | pub fn set_max_buf_size(&mut self, max_buf_size: usize) {
    method max_buf_size (line 586) | pub fn max_buf_size(&self) -> usize {
    method from (line 888) | fn from(std: StdFile) -> Self {
    method fmt (line 894) | fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
    method as_raw_fd (line 903) | fn as_raw_fd(&self) -> std::os::unix::io::RawFd {
    method as_fd (line 910) | fn as_fd(&self) -> std::os::unix::io::BorrowedFd<'_> {
    method from_raw_fd (line 919) | unsafe fn from_raw_fd(fd: std::os::unix::io::RawFd) -> Self {
  type Inner (line 96) | struct Inner {
    method complete_inflight (line 955) | async fn complete_inflight(&mut self) {
    method poll_complete_inflight (line 961) | fn poll_complete_inflight(&mut self, cx: &mut Context<'_>) -> Poll<()> {
    method poll_flush (line 973) | fn poll_flush(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), io::...
  type State (line 108) | enum State {
  type Operation (line 114) | enum Operation {
  method poll_read (line 592) | fn poll_read(
  method start_seek (line 665) | fn start_seek(self: Pin<&mut Self>, mut pos: SeekFrom) -> io::Result<()> {
  method poll_complete (line 697) | fn poll_complete(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll...
  method poll_write (line 729) | fn poll_write(
  method poll_write_vectored (line 800) | fn poll_write_vectored(
  method is_write_vectored (line 871) | fn is_write_vectored(&self) -> bool {
  method poll_flush (line 875) | fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Re...
  method poll_shutdown (line 881) | fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Res...

FILE: tokio/src/fs/file/tests.rs
  constant HELLO (line 9) | const HELLO: &[u8] = b"hello world...";
  constant FOO (line 10) | const FOO: &[u8] = b"foo bar baz...";
  function open_read (line 13) | fn open_read() {
  function read_twice_before_dispatch (line 39) | fn read_twice_before_dispatch() {
  function read_with_smaller_buf (line 63) | fn read_with_smaller_buf() {
  function read_with_bigger_buf (line 99) | fn read_with_bigger_buf() {
  function read_err_then_read_success (line 154) | fn read_err_then_read_success() {
  function open_write (line 196) | fn open_write() {
  function flush_while_idle (line 221) | fn flush_while_idle() {
  function read_with_buffer_larger_than_max (line 232) | fn read_with_buffer_larger_than_max() {
  function write_with_buffer_larger_than_max (line 304) | fn write_with_buffer_larger_than_max() {
  function write_twice_before_dispatch (line 372) | fn write_twice_before_dispatch() {
  function incomplete_read_followed_by_write (line 412) | fn incomplete_read_followed_by_write() {
  function incomplete_partial_read_followed_by_write (line 452) | fn incomplete_partial_read_followed_by_write() {
  function incomplete_read_followed_by_flush (line 496) | fn incomplete_read_followed_by_flush() {
  function incomplete_flush_followed_by_write (line 536) | fn incomplete_flush_followed_by_write() {
  function read_err (line 572) | fn read_err() {
  function write_write_err (line 592) | fn write_write_err() {
  function write_read_write_err (line 610) | fn write_read_write_err() {
  function write_read_flush_err (line 644) | fn write_read_flush_err() {
  function write_seek_write_err (line 678) | fn write_seek_write_err() {
  function write_seek_flush_err (line 710) | fn write_seek_flush_err() {
  function sync_all_ordered_after_write (line 742) | fn sync_all_ordered_after_write() {
  function sync_all_err_ordered_after_write (line 773) | fn sync_all_err_ordered_after_write() {
  function sync_data_ordered_after_write (line 806) | fn sync_data_ordered_after_write() {
  function sync_data_err_ordered_after_write (line 837) | fn sync_data_err_ordered_after_write() {
  function open_set_len_ok (line 870) | fn open_set_len_ok() {
  function open_set_len_err (line 886) | fn open_set_len_err() {
  function partial_read_set_len_ok (line 904) | fn partial_read_set_len_ok() {
  function busy_file_seek_error (line 960) | fn busy_file_seek_error() {

FILE: tokio/src/fs/hard_link.rs
  function hard_link (line 39) | pub async fn hard_link(original: impl AsRef<Path>, link: impl AsRef<Path...

FILE: tokio/src/fs/metadata.rs
  function metadata (line 43) | pub async fn metadata(path: impl AsRef<Path>) -> io::Result<Metadata> {

FILE: tokio/src/fs/mocks.rs
  method read (line 60) | fn read(&mut self, dst: &mut [u8]) -> io::Result<usize> {
  method read (line 73) | fn read(&mut self, dst: &mut [u8]) -> io::Result<usize> {
  method seek (line 86) | fn seek(&mut self, pos: SeekFrom) -> io::Result<u64> {
  method write (line 92) | fn write(&mut self, src: &[u8]) -> io::Result<usize> {
  method flush (line 96) | fn flush(&mut self) -> io::Result<()> {
  method from (line 104) | fn from(file: MockFile) -> OwnedFd {
  type JoinHandle (line 114) | pub(super) struct JoinHandle<T> {
  function spawn_blocking (line 118) | pub(super) fn spawn_blocking<F, R>(f: F) -> JoinHandle<R>
  function spawn_mandatory_blocking (line 133) | pub(super) fn spawn_mandatory_blocking<F, R>(f: F) -> Option<JoinHandle<R>>
  type Output (line 149) | type Output = Result<T, io::Error>;
  method poll (line 151) | fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Ou...
  function len (line 165) | pub(in super::super) fn len() -> usize {
  function run_one (line 169) | pub(in super::super) fn run_one() {

FILE: tokio/src/fs/mod.rs
  function asyncify (line 312) | pub(crate) async fn asyncify<F, T>(f: F) -> io::Result<T>

FILE: tokio/src/fs/open_options.rs
  type OpenOptions (line 88) | pub struct OpenOptions {
    method new (line 122) | pub fn new() -> OpenOptions {
    method read (line 168) | pub fn read(&mut self, read: bool) -> &mut OpenOptions {
    method write (line 212) | pub fn write(&mut self, write: bool) -> &mut OpenOptions {
    method append (line 285) | pub fn append(&mut self, append: bool) -> &mut OpenOptions {
    method truncate (line 332) | pub fn truncate(&mut self, truncate: bool) -> &mut OpenOptions {
    method create (line 382) | pub fn create(&mut self, create: bool) -> &mut OpenOptions {
    method create_new (line 439) | pub fn create_new(&mut self, create_new: bool) -> &mut OpenOptions {
    method open (line 520) | pub async fn open(&self, path: impl AsRef<Path>) -> io::Result<File> {
    method std_open (line 547) | async fn std_open(opts: &StdOpenOptions, path: impl AsRef<Path>) -> io...
    method as_inner_mut (line 556) | pub(super) fn as_inner_mut(&mut self) -> &mut StdOpenOptions {
    method from (line 841) | fn from(options: StdOpenOptions) -> OpenOptions {
  type Kind (line 93) | enum Kind {
  method default (line 853) | fn default() -> Self {

FILE: tokio/src/fs/open_options/uring_open_options.rs
  type UringOpenOptions (line 12) | pub(crate) struct UringOpenOptions {
    method new (line 24) | pub(crate) fn new() -> Self {
    method append (line 37) | pub(crate) fn append(&mut self, append: bool) -> &mut Self {
    method create (line 42) | pub(crate) fn create(&mut self, create: bool) -> &mut Self {
    method create_new (line 47) | pub(crate) fn create_new(&mut self, create_new: bool) -> &mut Self {
    method read (line 52) | pub(crate) fn read(&mut self, read: bool) -> &mut Self {
    method write (line 57) | pub(crate) fn write(&mut self, write: bool) -> &mut Self {
    method truncate (line 62) | pub(crate) fn truncate(&mut self, truncate: bool) -> &mut Self {
    method mode (line 67) | pub(crate) fn mode(&mut self, mode: u32) -> &mut Self {
    method custom_flags (line 72) | pub(crate) fn custom_flags(&mut self, flags: i32) -> &mut Self {
    method access_mode (line 78) | pub(crate) fn access_mode(&self) -> io::Result<libc::c_int> {
    method creation_mode (line 90) | pub(crate) fn creation_mode(&self) -> io::Result<libc::c_int> {
  method from (line 116) | fn from(value: UringOpenOptions) -> Self {

FILE: tokio/src/fs/read.rs
  function read (line 56) | pub async fn read(path: impl AsRef<Path>) -> io::Result<Vec<u8>> {

FILE: tokio/src/fs/read_dir.rs
  constant CHUNK_SIZE (line 22) | const CHUNK_SIZE: usize = 32;
  function read_dir (line 32) | pub async fn read_dir(path: impl AsRef<Path>) -> io::Result<ReadDir> {
  type ReadDir (line 64) | pub struct ReadDir(State);
    method next_entry (line 78) | pub async fn next_entry(&mut self) -> io::Result<Option<DirEntry>> {
    method poll_next_entry (line 101) | pub fn poll_next_entry(&mut self, cx: &mut Context<'_>) -> Poll<io::Re...
    method next_chunk (line 127) | fn next_chunk(buf: &mut VecDeque<io::Result<DirEntry>>, std: &mut std:...
  type State (line 67) | enum State {
  type DirEntry (line 200) | pub struct DirEntry {
    method path (line 244) | pub fn path(&self) -> PathBuf {
    method file_name (line 265) | pub fn file_name(&self) -> OsString {
    method metadata (line 299) | pub async fn metadata(&self) -> io::Result<Metadata> {
    method file_type (line 334) | pub async fn file_type(&self) -> io::Result<FileType> {
    method as_inner (line 354) | pub(super) fn as_inner(&self) -> &std::fs::DirEntry {

FILE: tokio/src/fs/read_link.rs
  function read_link (line 9) | pub async fn read_link(path: impl AsRef<Path>) -> io::Result<PathBuf> {

FILE: tokio/src/fs/read_to_string.rs
  function read_to_string (line 27) | pub async fn read_to_string(path: impl AsRef<Path>) -> io::Result<String> {

FILE: tokio/src/fs/read_uring.rs
  constant PROBE_SIZE (line 11) | const PROBE_SIZE: usize = 32;
  constant PROBE_SIZE_U32 (line 12) | const PROBE_SIZE_U32: u32 = PROBE_SIZE as u32;
  constant MAX_READ_SIZE (line 17) | const MAX_READ_SIZE: usize = 64 * 1024 * 1024;
  function read_uring (line 19) | pub(crate) async fn read_uring(path: &Path) -> io::Result<Vec<u8>> {
  function read_to_end_uring (line 39) | async fn read_to_end_uring(mut fd: OwnedFd, mut buf: Vec<u8>) -> io::Res...
  function small_probe_read (line 83) | async fn small_probe_read(
  function op_read (line 112) | async fn op_read(

FILE: tokio/src/fs/remove_dir.rs
  function remove_dir (line 9) | pub async fn remove_dir(path: impl AsRef<Path>) -> io::Result<()> {

FILE: tokio/src/fs/remove_dir_all.rs
  function remove_dir_all (line 11) | pub async fn remove_dir_all(path: impl AsRef<Path>) -> io::Result<()> {

FILE: tokio/src/fs/remove_file.rs
  function remove_file (line 13) | pub async fn remove_file(path: impl AsRef<Path>) -> io::Result<()> {

FILE: tokio/src/fs/rename.rs
  function rename (line 12) | pub async fn rename(from: impl AsRef<Path>, to: impl AsRef<Path>) -> io:...

FILE: tokio/src/fs/set_permissions.rs
  function set_permissions (line 12) | pub async fn set_permissions(path: impl AsRef<Path>, perm: Permissions) ...

FILE: tokio/src/fs/symlink.rs
  function symlink (line 11) | pub async fn symlink(original: impl AsRef<Path>, link: impl AsRef<Path>)...

FILE: tokio/src/fs/symlink_dir.rs
  function symlink_dir (line 14) | pub async fn symlink_dir(original: impl AsRef<Path>, link: impl AsRef<Pa...

FILE: tokio/src/fs/symlink_file.rs
  function symlink_file (line 14) | pub async fn symlink_file(original: impl AsRef<Path>, link: impl AsRef<P...

FILE: tokio/src/fs/symlink_metadata.rs
  function symlink_metadata (line 12) | pub async fn symlink_metadata(path: impl AsRef<Path>) -> io::Result<Meta...

FILE: tokio/src/fs/try_exists.rs
  function try_exists (line 25) | pub async fn try_exists(path: impl AsRef<Path>) -> io::Result<bool> {

FILE: tokio/src/fs/write.rs
  function write (line 26) | pub async fn write(path: impl AsRef<Path>, contents: impl AsRef<[u8]>) -...
  function write_uring (line 58) | async fn write_uring(path: &Path, mut buf: OwnedBuf) -> io::Result<()> {
  function write_spawn_blocking (line 96) | async fn write_spawn_blocking(path: &Path, contents: OwnedBuf) -> io::Re...

FILE: tokio/src/future/maybe_done.rs
  function maybe_done (line 26) | pub fn maybe_done<F: IntoFuture>(future: F) -> MaybeDone<F::IntoFuture> {
  function output_mut (line 37) | pub fn output_mut(self: Pin<&mut Self>) -> Option<&mut Fut::Output> {
  function take_output (line 47) | pub fn take_output(self: Pin<&mut Self>) -> Option<Fut::Output> {
  type Output (line 61) | type Output = ();
  method poll (line 63) | fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Ou...
  type ThingAdder (line 86) | struct ThingAdder<'a> {
  type Output (line 91) | type Output = ();
  method poll (line 93) | fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Self::Outpu...
  function maybe_done_miri (line 102) | fn maybe_done_miri() {
  type DummyWaker (line 118) | struct DummyWaker;
  method wake (line 121) | fn wake(self: Arc<Self>) {}

FILE: tokio/src/future/trace.rs
  type InstrumentedFuture (line 3) | pub(crate) trait InstrumentedFuture: Future {
    method id (line 4) | fn id(&self) -> Option<tracing::Id>;
    method id (line 8) | fn id(&self) -> Option<tracing::Id> {

FILE: tokio/src/future/try_join.rs
  function try_join3 (line 8) | pub(crate) fn try_join3<T1, F1, T2, F2, T3, F3, E>(
  type Output (line 47) | type Output = Result<(T1, T2, T3), E>;
  method poll (line 49) | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {

FILE: tokio/src/io/async_buf_read.rs
  type AsyncBufRead (line 23) | pub trait AsyncBufRead: AsyncRead {
    method poll_fill_buf (line 45) | fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<i...
    method consume (line 62) | fn consume(self: Pin<&mut Self>, amt: usize);
    method poll_fill_buf (line 90) | fn poll_fill_buf(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<i...
    method consume (line 94) | fn consume(self: Pin<&mut Self>, amt: usize) {
    method poll_fill_buf (line 100) | fn poll_fill_buf(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<...
    method consume (line 104) | fn consume(mut self: Pin<&mut Self>, amt: usize) {
    method poll_fill_buf (line 110) | fn poll_fill_buf(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<...
    method consume (line 114) | fn consume(self: Pin<&mut Self>, amt: usize) {

FILE: tokio/src/io/async_fd.rs
  type AsyncFd (line 181) | pub struct AsyncFd<T: AsRawFd> {
  type AsyncFdReadyGuard (line 194) | pub struct AsyncFdReadyGuard<'a, T: AsRawFd> {
  type AsyncFdReadyMutGuard (line 205) | pub struct AsyncFdReadyMutGuard<'a, T: AsRawFd> {
  function new (line 226) | pub fn new(inner: T) -> io::Result<Self>
  function with_interest (line 243) | pub fn with_interest(inner: T, interest: Interest) -> io::Result<Self>
  function new_with_handle_and_interest (line 251) | pub(crate) fn new_with_handle_and_interest(
  function try_new (line 277) | pub fn try_new(inner: T) -> Result<Self, AsyncFdTryNewError<T>>
  function try_with_interest (line 297) | pub fn try_with_interest(inner: T, interest: Interest) -> Result<Self, A...
  function try_new_with_handle_and_interest (line 305) | pub(crate) fn try_new_with_handle_and_interest(
  function get_ref (line 323) | pub fn get_ref(&self) -> &T {
  function get_mut (line 329) | pub fn get_mut(&mut self) -> &mut T {
  function take_inner (line 333) | fn take_inner(&mut self) -> Option<T> {
  function into_inner (line 344) | pub fn into_inner(mut self) -> T {
  function poll_read_ready (line 375) | pub fn poll_read_ready<'a>(
  function poll_read_ready_mut (line 412) | pub fn poll_read_ready_mut<'a>(
  function poll_write_ready (line 451) | pub fn poll_write_ready<'a>(
  function poll_write_ready_mut (line 488) | pub fn poll_write_ready_mut<'a>(
  function ready (line 589) | pub async fn ready(&self, interest: Interest) -> io::Result<AsyncFdReady...
  function ready_mut (line 685) | pub async fn ready_mut(
  function readable (line 713) | pub async fn readable<'a>(&'a self) -> io::Result<AsyncFdReadyGuard<'a, ...
  function readable_mut (line 731) | pub async fn readable_mut<'a>(&'a mut self) -> io::Result<AsyncFdReadyMu...
  function writable (line 751) | pub async fn writable<'a>(&'a self) -> io::Result<AsyncFdReadyGuard<'a, ...
  function writable_mut (line 769) | pub async fn writable_mut<'a>(&'a mut self) -> io::Result<AsyncFdReadyMu...
  function async_io (line 850) | pub async fn async_io<R>(
  function async_io_mut (line 866) | pub async fn async_io_mut<R>(
  function try_io (line 902) | pub fn try_io<R>(
  function try_io_mut (line 917) | pub fn try_io_mut<R>(
  method as_raw_fd (line 928) | fn as_raw_fd(&self) -> RawFd {
  function as_fd (line 934) | fn as_fd(&self) -> std::os::unix::io::BorrowedFd<'_> {
  function fmt (line 940) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  method drop (line 948) | fn drop(&mut self) {
  function clear_ready (line 969) | pub fn clear_ready(&mut self) {
  function clear_ready_matching (line 1058) | pub fn clear_ready_matching(&mut self, ready: Ready) {
  function retain_ready (line 1078) | pub fn retain_ready(&mut self) {
  function ready (line 1089) | pub fn ready(&self) -> Ready {
  function try_io (line 1151) | pub fn try_io<R>(
  function get_ref (line 1167) | pub fn get_ref(&self) -> &'a AsyncFd<Inner> {
  function get_inner (line 1172) | pub fn get_inner(&self) -> &'a Inner {
  function clear_ready (line 1193) | pub fn clear_ready(&mut self) {
  function clear_ready_matching (line 1282) | pub fn clear_ready_matching(&mut self, ready: Ready) {
  function retain_ready (line 1302) | pub fn retain_ready(&mut self) {
  function ready (line 1313) | pub fn ready(&self) -> Ready {
  function try_io (line 1336) | pub fn try_io<R>(
  function get_ref (line 1352) | pub fn get_ref(&self) -> &AsyncFd<Inner> {
  function get_mut (line 1357) | pub fn get_mut(&mut self) -> &mut AsyncFd<Inner> {
  function get_inner (line 1362) | pub fn get_inner(&self) -> &Inner {
  function get_inner_mut (line 1367) | pub fn get_inner_mut(&mut self) -> &mut Inner {
  function fmt (line 1373) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  function fmt (line 1381) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  type TryIoError (line 1395) | pub struct TryIoError(());
  type AsyncFdTryNewError (line 1401) | pub struct AsyncFdTryNewError<T> {
  function into_parts (line 1412) | pub fn into_parts(self) -> (T, io::Error) {
  function fmt (line 1418) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function fmt (line 1424) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  method source (line 1430) | fn source(&self) -> Option<&(dyn Error + 'static)> {
  function from (line 1436) | fn from(value: AsyncFdTryNewError<T>) -> Self {

FILE: tokio/src/io/async_read.rs
  type AsyncRead (line 44) | pub trait AsyncRead {
    method poll_read (line 55) | fn poll_read(
    method poll_read (line 87) | fn poll_read(
    method poll_read (line 97) | fn poll_read(
    method poll_read (line 111) | fn poll_read(

FILE: tokio/src/io/async_seek.rs
  type AsyncSeek (line 18) | pub trait AsyncSeek {
    method start_seek (line 33) | fn start_seek(self: Pin<&mut Self>, position: SeekFrom) -> io::Result<...
    method poll_complete (line 52) | fn poll_complete(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<i...
    method start_seek (line 80) | fn start_seek(self: Pin<&mut Self>, pos: SeekFrom) -> io::Result<()> {
    method poll_complete (line 84) | fn poll_complete(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<i...
    method start_seek (line 90) | fn start_seek(mut self: Pin<&mut Self>, pos: SeekFrom) -> io::Result<(...
    method poll_complete (line 93) | fn poll_complete(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<io...

FILE: tokio/src/io/async_write.rs
  type AsyncWrite (line 39) | pub trait AsyncWrite {
    method poll_write (line 52) | fn poll_write(
    method poll_flush (line 67) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::...
    method poll_shutdown (line 127) | fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<i...
    method poll_write_vectored (line 152) | fn poll_write_vectored(
    method is_write_vectored (line 174) | fn is_write_vectored(&self) -> bool {
    method poll_write (line 224) | fn poll_write(
    method poll_write_vectored (line 232) | fn poll_write_vectored(
    method is_write_vectored (line 240) | fn is_write_vectored(&self) -> bool {
    method poll_flush (line 244) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::...
    method poll_shutdown (line 248) | fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<i...
    method poll_write (line 254) | fn poll_write(
    method poll_write_vectored (line 263) | fn poll_write_vectored(
    method is_write_vectored (line 271) | fn is_write_vectored(&self) -> bool {
    method poll_flush (line 275) | fn poll_flush(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<io:...
    method poll_shutdown (line 279) | fn poll_shutdown(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<...
    method poll_write (line 285) | fn poll_write(
    method poll_write_vectored (line 293) | fn poll_write_vectored(
    method is_write_vectored (line 301) | fn is_write_vectored(&self) -> bool {
    method poll_flush (line 305) | fn poll_flush(mut self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<i...
    method poll_shutdown (line 309) | fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<i...
    method poll_write (line 315) | fn poll_write(
    method poll_write_vectored (line 323) | fn poll_write_vectored(
    method is_write_vectored (line 331) | fn is_write_vectored(&self) -> bool {
    method poll_flush (line 335) | fn poll_flush(mut self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<i...
    method poll_shutdown (line 339) | fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<i...
    method poll_write (line 345) | fn poll_write(
    method poll_write_vectored (line 353) | fn poll_write_vectored(
    method is_write_vectored (line 361) | fn is_write_vectored(&self) -> bool {
    method poll_flush (line 365) | fn poll_flush(mut self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<i...
    method poll_shutdown (line 369) | fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<i...
    method poll_write (line 375) | fn poll_write(
    method poll_write_vectored (line 383) | fn poll_write_vectored(
    method is_write_vectored (line 391) | fn is_write_vectored(&self) -> bool {
    method poll_flush (line 395) | fn poll_flush(mut self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<i...
    method poll_shutdown (line 399) | fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<i...

FILE: tokio/src/io/blocking.rs
  type Blocking (line 14) | pub(crate) struct Blocking<T> {
  type Buf (line 22) | pub(crate) struct Buf {
    method with_capacity (line 196) | pub(crate) fn with_capacity(n: usize) -> Buf {
    method is_empty (line 203) | pub(crate) fn is_empty(&self) -> bool {
    method len (line 207) | pub(crate) fn len(&self) -> usize {
    method copy_to (line 211) | pub(crate) fn copy_to(&mut self, dst: &mut ReadBuf<'_>) -> usize {
    method copy_from (line 224) | pub(crate) fn copy_from(&mut self, src: &[u8], max_buf_size: usize) ->...
    method bytes (line 233) | pub(crate) fn bytes(&self) -> &[u8] {
    method read_from (line 241) | pub(crate) unsafe fn read_from<T: Read>(
    method write_to (line 270) | pub(crate) fn write_to<T: Write>(&mut self, wr: &mut T) -> io::Result<...
  constant DEFAULT_MAX_BUF_SIZE (line 27) | pub(crate) const DEFAULT_MAX_BUF_SIZE: usize = 2 * 1024 * 1024;
  type State (line 30) | enum State<T> {
  method poll_read (line 57) | fn poll_read(
  method poll_write (line 109) | fn poll_write(
  method poll_flush (line 146) | fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Re...
  method poll_shutdown (line 178) | fn poll_shutdown(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Re...

FILE: tokio/src/io/bsd/poll_aio.rs
  type AioSource (line 20) | pub trait AioSource {
    method register (line 22) | fn register(&mut self, kq: RawFd, token: usize);
    method deregister (line 25) | fn deregister(&mut self);
  type MioSource (line 30) | struct MioSource<T>(T);
  method register (line 33) | fn register(
  method deregister (line 44) | fn deregister(&mut self, _registry: &Registry) -> io::Result<()> {
  method reregister (line 49) | fn reregister(
  type Aio (line 90) | pub struct Aio<E> {
  function new_for_aio (line 104) | pub fn new_for_aio(io: E) -> io::Result<Self> {
  function new_for_lio (line 116) | pub fn new_for_lio(io: E) -> io::Result<Self> {
  function new_with_interest (line 120) | fn new_with_interest(io: E, interest: Interest) -> io::Result<Self> {
  function clear_ready (line 144) | pub fn clear_ready(&self, ev: AioEvent) {
  function into_inner (line 149) | pub fn into_inner(self) -> E {
  function poll_ready (line 167) | pub fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<io::Result<AioEve...
  type Target (line 174) | type Target = E;
  method deref (line 176) | fn deref(&self) -> &E {
  method deref_mut (line 182) | fn deref_mut(&mut self) -> &mut E {
  function fmt (line 188) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type AioEvent (line 197) | pub struct AioEvent(ReadyEvent);

FILE: tokio/src/io/interest.rs
  constant READABLE (line 10) | const READABLE: usize = 0b0001;
  constant WRITABLE (line 11) | const WRITABLE: usize = 0b0010;
  constant AIO (line 14) | const AIO: usize = 0b0100;
  constant LIO (line 16) | const LIO: usize = 0b1000;
  constant PRIORITY (line 18) | const PRIORITY: usize = 0b0001_0000;
  constant ERROR (line 21) | const ERROR: usize = 0b0010_0000;
  type Interest (line 29) | pub struct Interest(usize);
    constant READABLE (line 55) | pub const READABLE: Interest = Interest(READABLE);
    constant WRITABLE (line 60) | pub const WRITABLE: Interest = Interest(WRITABLE);
    constant ERROR (line 66) | pub const ERROR: Interest = Interest(ERROR);
    constant PRIORITY (line 71) | pub const PRIORITY: Interest = Interest(PRIORITY);
    method is_readable (line 86) | pub const fn is_readable(self) -> bool {
    method is_writable (line 103) | pub const fn is_writable(self) -> bool {
    method is_error (line 120) | pub const fn is_error(self) -> bool {
    method is_aio (line 125) | const fn is_aio(self) -> bool {
    method is_lio (line 130) | const fn is_lio(self) -> bool {
    method is_priority (line 149) | pub const fn is_priority(self) -> bool {
    method add (line 167) | pub const fn add(self, other: Interest) -> Interest {
    method remove (line 195) | pub fn remove(self, other: Interest) -> Option<Interest> {
    method to_mio (line 206) | pub(crate) fn to_mio(self) -> mio::Interest {
    method mask (line 258) | pub(crate) fn mask(self) -> Ready {
    type Output (line 271) | type Output = Self;
    method bitor (line 274) | fn bitor(self, other: Self) -> Self {
    method bitor_assign (line 281) | fn bitor_assign(&mut self, other: Self) {
    method fmt (line 287) | fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {

FILE: tokio/src/io/join.rs
  function join (line 11) | pub fn join<R, W>(reader: R, writer: W) -> Join<R, W
Condensed preview — 842 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (5,998K chars).
[
  {
    "path": ".cirrus.yml",
    "chars": 2770,
    "preview": "only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'master' || $CIRRUS_BRANCH =~ 'tokio-.*')\nauto_canc"
  },
  {
    "path": ".github/FUNDING.yml",
    "chars": 66,
    "preview": "# These are supported funding model platforms\n\ngithub: [tokio-rs]\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "chars": 623,
    "preview": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: A-tokio, C-bug\nassignees: ''\n\n---\n\n**Ve"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "chars": 163,
    "preview": "contact_links:\n  - name: Question\n    url: https://github.com/tokio-rs/tokio/discussions\n    about: Questions about Toki"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "chars": 619,
    "preview": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: A-tokio, C-feature-request\nassignees"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "chars": 758,
    "preview": "<!--\nThank you for your Pull Request. Please provide a description above and review\nthe requirements below.\n\nBug fixes a"
  },
  {
    "path": ".github/buildomat/README.md",
    "chars": 920,
    "preview": "# Buildomat illumos CI\n\nThis directory contains CI configurations for the [illumos] operating system.\nTokio's illumos CI"
  },
  {
    "path": ".github/buildomat/config.toml",
    "chars": 359,
    "preview": "# Repository-level Buildomat configuration.\n# See: https://github.com/oxidecomputer/buildomat#per-repository-configurati"
  },
  {
    "path": ".github/labeler.yml",
    "chars": 628,
    "preview": "R-loom-blocking:\n- tokio/src/runtime/blocking/*\n- tokio/src/runtime/blocking/**/*\n\nR-loom-sync:\n- tokio/src/sync/*\n- tok"
  },
  {
    "path": ".github/workflows/audit.yml",
    "chars": 399,
    "preview": "name: Security Audit\n\non:\n  push:\n    branches:\n      - master\n    paths:\n      - '**/Cargo.toml'\n  schedule:\n    - cron"
  },
  {
    "path": ".github/workflows/ci.yml",
    "chars": 44953,
    "preview": "on:\n  push:\n    branches: [\"master\", \"tokio-*.x\"]\n  pull_request:\n    branches: [\"master\", \"tokio-*.x\"]\n\nname: CI\n\nconcu"
  },
  {
    "path": ".github/workflows/labeler.yml",
    "chars": 625,
    "preview": "name: \"Pull Request Labeler\"\non:\n- pull_request_target\n\n# See .github/labeler.yml file\n\nconcurrency:\n  group: ${{ github"
  },
  {
    "path": ".github/workflows/loom.yml",
    "chars": 4792,
    "preview": "on:\n  push:\n    branches: [\"master\", \"tokio-*.x\"]\n  pull_request:\n    types: [labeled, opened, synchronize, reopened]\n  "
  },
  {
    "path": ".github/workflows/pr-audit.yml",
    "chars": 429,
    "preview": "name: Pull Request Security Audit\n\non:\n  push:\n    paths:\n      - '**/Cargo.toml'\n  pull_request:\n    paths:\n      - '**"
  },
  {
    "path": ".github/workflows/stress-test.yml",
    "chars": 1249,
    "preview": "name: Stress Test\non:\n  pull_request:\n  push:\n    branches:\n      - master\n\nconcurrency:\n  group: ${{ github.workflow }}"
  },
  {
    "path": ".github/workflows/uring-kernel-version-test.yml",
    "chars": 3612,
    "preview": "name: Uring Kernel Version Test\n\non:\n  workflow_call:\n    inputs:\n      kernel_version:\n        description: 'Version of"
  },
  {
    "path": ".gitignore",
    "chars": 53,
    "preview": "target\nCargo.lock\n\n.cargo/config.toml\n.cargo/config\n\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "chars": 361,
    "preview": "# Code of Conduct\n\nThe Tokio project adheres to the [Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-co"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 1789,
    "preview": "# Contributing to Tokio\n\nThanks for your help improving Tokio! We are so happy to have you!\n\nThere are opportunities to "
  },
  {
    "path": "Cargo.toml",
    "chars": 835,
    "preview": "[workspace]\nresolver = \"2\"\nmembers = [\n  \"tokio\",\n  \"tokio-macros\",\n  \"tokio-test\",\n  \"tokio-stream\",\n  \"tokio-util\",\n\n "
  },
  {
    "path": "Cross.toml",
    "chars": 69,
    "preview": "[build.env]\npassthrough = [\n    \"RUSTFLAGS\",\n    \"RUST_BACKTRACE\",\n]\n"
  },
  {
    "path": "LICENSE",
    "chars": 1070,
    "preview": "MIT License\n\nCopyright (c) Tokio Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a c"
  },
  {
    "path": "README.md",
    "chars": 9347,
    "preview": "*[TokioConf 2026 program and tickets are now available!](https://tokioconf.com)*\n\n---\n\n# Tokio\n\nA runtime for writing re"
  },
  {
    "path": "SECURITY.md",
    "chars": 1491,
    "preview": "## Report a security issue\n\nThe Tokio project team welcomes security reports and is committed to providing prompt attent"
  },
  {
    "path": "benches/Cargo.toml",
    "chars": 1731,
    "preview": "[package]\nname = \"benches\"\nversion = \"0.0.0\"\npublish = false\nedition = \"2021\"\nlicense = \"MIT\"\n\n[features]\ntest-util = [\""
  },
  {
    "path": "benches/copy.rs",
    "chars": 7670,
    "preview": "use criterion::{criterion_group, criterion_main, Criterion};\n\nuse rand::{Rng, SeedableRng};\nuse rand_chacha::ChaCha20Rng"
  },
  {
    "path": "benches/fs.rs",
    "chars": 2824,
    "preview": "#![cfg(unix)]\n\nuse tokio_stream::StreamExt;\n\nuse tokio::fs::File;\nuse tokio::io::AsyncReadExt;\nuse tokio_util::codec::{B"
  },
  {
    "path": "benches/remote_spawn.rs",
    "chars": 3900,
    "preview": "//! Benchmark remote task spawning (push_remote_task) at different concurrency\n//! levels on the multi-threaded schedule"
  },
  {
    "path": "benches/rt_current_thread.rs",
    "chars": 2277,
    "preview": "//! Benchmark implementation details of the threaded scheduler. These benches are\n//! intended to be used as a form of r"
  },
  {
    "path": "benches/rt_multi_threaded.rs",
    "chars": 7447,
    "preview": "//! Benchmark implementation details of the threaded scheduler. These benches are\n//! intended to be used as a form of r"
  },
  {
    "path": "benches/signal.rs",
    "chars": 2426,
    "preview": "//! Benchmark the delay in propagating OS signals to any listeners.\n#![cfg(unix)]\n\nuse criterion::{criterion_group, crit"
  },
  {
    "path": "benches/spawn.rs",
    "chars": 2478,
    "preview": "//! Benchmark spawning a task onto the basic and threaded Tokio executors.\n//! This essentially measure the time to enqu"
  },
  {
    "path": "benches/spawn_blocking.rs",
    "chars": 2300,
    "preview": "//! Benchmark spawn_blocking at different concurrency levels on the multi-threaded scheduler.\n//!\n//! For each paralleli"
  },
  {
    "path": "benches/sync_broadcast.rs",
    "chars": 2399,
    "preview": "use rand::{Rng, RngCore, SeedableRng};\nuse std::sync::atomic::{AtomicUsize, Ordering};\nuse std::sync::Arc;\nuse tokio::sy"
  },
  {
    "path": "benches/sync_mpsc.rs",
    "chars": 9292,
    "preview": "use tokio::sync::mpsc;\n\nuse criterion::measurement::WallTime;\nuse criterion::{black_box, criterion_group, criterion_main"
  },
  {
    "path": "benches/sync_mpsc_oneshot.rs",
    "chars": 1387,
    "preview": "use tokio::{\n    runtime::Runtime,\n    sync::{mpsc, oneshot},\n};\n\nuse criterion::{criterion_group, criterion_main, Crite"
  },
  {
    "path": "benches/sync_notify.rs",
    "chars": 2857,
    "preview": "use std::sync::atomic::{AtomicUsize, Ordering};\nuse std::sync::Arc;\n\nuse tokio::sync::Notify;\n\nuse criterion::measuremen"
  },
  {
    "path": "benches/sync_rwlock.rs",
    "chars": 4913,
    "preview": "use std::sync::Arc;\nuse tokio::{sync::RwLock, task};\n\nuse criterion::measurement::WallTime;\nuse criterion::{black_box, c"
  },
  {
    "path": "benches/sync_semaphore.rs",
    "chars": 4106,
    "preview": "use std::sync::Arc;\nuse tokio::runtime::Runtime;\nuse tokio::{sync::Semaphore, task};\n\nuse criterion::measurement::WallTi"
  },
  {
    "path": "benches/sync_watch.rs",
    "chars": 2698,
    "preview": "use rand::prelude::*;\nuse std::sync::atomic::{AtomicU64, Ordering};\nuse std::sync::Arc;\nuse tokio::sync::{watch, Notify}"
  },
  {
    "path": "benches/time_now.rs",
    "chars": 686,
    "preview": "//! Benchmark spawning a task onto the basic and threaded Tokio executors.\n//! This essentially measure the time to enqu"
  },
  {
    "path": "benches/time_timeout.rs",
    "chars": 2909,
    "preview": "use std::time::{Duration, Instant};\n\nuse criterion::{black_box, criterion_group, criterion_main, Criterion};\nuse tokio::"
  },
  {
    "path": "deny.toml",
    "chars": 329,
    "preview": "# https://embarkstudios.github.io/cargo-deny/cli/init.html\n\n[graph]\nall-features = true\n\n[licenses]\nallow = [\n    \"MIT\","
  },
  {
    "path": "docs/contributing/README.md",
    "chars": 2836,
    "preview": "# Contributing\n\nThis guide will help you get started. **Do not let this guide intimidate you**.\nIt should be considered "
  },
  {
    "path": "docs/contributing/contributing-in-issues.md",
    "chars": 3724,
    "preview": "## Contributing in Issues\n\nFor any issue, there are fundamentally three ways an individual can contribute:\n\n1. By openin"
  },
  {
    "path": "docs/contributing/how-to-specify-crates-dependencies-versions.md",
    "chars": 1445,
    "preview": "# How to specify crates dependencies versions\n\nEach crate (e.g., `tokio-util`, `tokio-stream`, etc.) should specify depe"
  },
  {
    "path": "docs/contributing/keeping-track-of-issues-and-prs.md",
    "chars": 3804,
    "preview": "## Keeping track of issues and PRs\n\nThe Tokio GitHub repository has a lot of issues and PRs to keep track of. This\nsecti"
  },
  {
    "path": "docs/contributing/pull-requests.md",
    "chars": 12442,
    "preview": "## Pull Requests\n\nPull Requests are the way concrete changes are made to the code, documentation,\nand dependencies in th"
  },
  {
    "path": "docs/contributing/reviewing-pull-requests.md",
    "chars": 4054,
    "preview": "## Reviewing Pull Requests\n\n**Any Tokio community member is welcome to review any pull request**.\n\nAll Tokio contributor"
  },
  {
    "path": "examples/Cargo.toml",
    "chars": 2122,
    "preview": "[package]\nname = \"examples\"\nversion = \"0.0.0\"\npublish = false\nedition = \"2021\"\nlicense = \"MIT\"\n\n# If you copy one of the"
  },
  {
    "path": "examples/README.md",
    "chars": 752,
    "preview": "## Examples of how to use Tokio\n\nThis directory contains a number of examples showcasing various capabilities of\nthe `to"
  },
  {
    "path": "examples/chat.rs",
    "chars": 8850,
    "preview": "//! A chat server that broadcasts a message to all connections.\n//!\n//! This example is explicitly more verbose than it "
  },
  {
    "path": "examples/connect-tcp.rs",
    "chars": 2616,
    "preview": "//! An example of hooking up stdin/stdout to a TCP stream.\n//!\n//! This example will connect to a socket address specifi"
  },
  {
    "path": "examples/connect-udp.rs",
    "chars": 2856,
    "preview": "//! An example of hooking up stdin/stdout to a UDP stream.\n//!\n//! This example will connect to a socket address specifi"
  },
  {
    "path": "examples/custom-executor-tokio-context.rs",
    "chars": 997,
    "preview": "// This example shows how to use the tokio runtime with any other executor\n//\n//It takes advantage from RuntimeExt which"
  },
  {
    "path": "examples/custom-executor.rs",
    "chars": 1642,
    "preview": "// This example shows how to use the tokio runtime with any other executor\n//\n// The main components are a spawn fn that"
  },
  {
    "path": "examples/dump.rs",
    "chars": 2865,
    "preview": "//! This example demonstrates tokio's experimental task dumping functionality.\n//! This application deadlocks. Input CTR"
  },
  {
    "path": "examples/echo-tcp.rs",
    "chars": 3212,
    "preview": "//! A \"hello world\" echo server with Tokio\n//!\n//! This server will create a TCP listener, accept connections in a loop,"
  },
  {
    "path": "examples/echo-udp.rs",
    "chars": 1884,
    "preview": "//! An UDP echo server that just sends back everything that it receives.\n//!\n//! If you're on Unix you can test this out"
  },
  {
    "path": "examples/hello_world.rs",
    "chars": 842,
    "preview": "//! A simple client that opens a TCP stream, writes \"hello world\\n\", and closes\n//! the connection.\n//!\n//! To start a s"
  },
  {
    "path": "examples/named-pipe-multi-client.rs",
    "chars": 3046,
    "preview": "use std::io;\n\n#[cfg(windows)]\nasync fn windows_main() -> io::Result<()> {\n    use std::time::Duration;\n    use tokio::io"
  },
  {
    "path": "examples/named-pipe-ready.rs",
    "chars": 4327,
    "preview": "use std::io;\n\n#[cfg(windows)]\nasync fn windows_main() -> io::Result<()> {\n    use tokio::io::Interest;\n    use tokio::ne"
  },
  {
    "path": "examples/named-pipe.rs",
    "chars": 1571,
    "preview": "use std::io;\n\n#[cfg(windows)]\nasync fn windows_main() -> io::Result<()> {\n    use tokio::io::AsyncWriteExt;\n    use toki"
  },
  {
    "path": "examples/print_each_packet.rs",
    "chars": 3817,
    "preview": "//! A \"print-each-packet\" server with Tokio\n//!\n//! This server will create a TCP listener, accept connections in a loop"
  },
  {
    "path": "examples/proxy.rs",
    "chars": 1770,
    "preview": "//! A proxy that forwards data to another server and forwards that server's\n//! responses back to clients.\n//!\n//! Becau"
  },
  {
    "path": "examples/tinydb.rs",
    "chars": 7823,
    "preview": "//! A \"tiny database\" and accompanying protocol\n//!\n//! This example shows the usage of shared state amongst all connect"
  },
  {
    "path": "examples/tinyhttp.rs",
    "chars": 10251,
    "preview": "//! A \"tiny\" example of HTTP request/response handling using transports.\n//!\n//! This example is intended for *learning "
  },
  {
    "path": "examples/udp-client.rs",
    "chars": 2017,
    "preview": "//! A UDP client that just sends everything it gets via `stdio` in a single datagram, and then\n//! waits for a reply.\n//"
  },
  {
    "path": "examples/udp-codec.rs",
    "chars": 2516,
    "preview": "//! This example leverages `BytesCodec` to create a UDP client and server which\n//! speak a custom protocol.\n//!\n//! Her"
  },
  {
    "path": "netlify.toml",
    "chars": 346,
    "preview": "[build]\n  command = \"\"\"\n    rustup install nightly --profile minimal && cargo doc --no-deps --all-features\n    \"\"\"\n  pub"
  },
  {
    "path": "spellcheck.dic",
    "chars": 2411,
    "preview": "312\n&\n+\n<\n=\n>\n\\\n~\n—\n0o777\n0s\n0xA\n0xD\n100ms\n100ns\n10ms\n10μs\n~12\n120s\n12.5%\n±1m\n±1ms\n1ms\n1s\n25%\n250ms\n2x\n~4\n443\n450ms\n50ms"
  },
  {
    "path": "spellcheck.toml",
    "chars": 217,
    "preview": "dev_comments = false\nskip_readme = false\n\n[Hunspell]\nlang = \"en_US\"\nsearch_dirs = [\".\"]\nextra_dictionaries = [\"spellchec"
  },
  {
    "path": "stress-test/Cargo.toml",
    "chars": 391,
    "preview": "[package]\nname = \"stress-test\"\nversion = \"0.1.0\"\nauthors = [\"Tokio Contributors <team@tokio.rs>\"]\nedition = \"2021\"\nlicen"
  },
  {
    "path": "stress-test/examples/simple_echo_tcp.rs",
    "chars": 1891,
    "preview": "//! Simple TCP echo server to check memory leaks using Valgrind.\nuse std::{thread::sleep, time::Duration};\n\nuse tokio::{"
  },
  {
    "path": "target-specs/README.md",
    "chars": 462,
    "preview": "This is used for the `no-atomic-u64-test` ci check that verifies that Tokio\nworks even if the `AtomicU64` type is missin"
  },
  {
    "path": "target-specs/i686-unknown-linux-gnu.json",
    "chars": 1021,
    "preview": "{\n  \"arch\": \"x86\",\n  \"cpu\": \"pentium4\",\n  \"crt-objects-fallback\": \"false\",\n  \"crt-static-respected\": true,\n  \"data-layou"
  },
  {
    "path": "tests-build/Cargo.toml",
    "chars": 360,
    "preview": "[package]\nname = \"tests-build\"\nversion = \"0.1.0\"\nauthors = [\"Tokio Contributors <team@tokio.rs>\"]\nedition = \"2021\"\nlicen"
  },
  {
    "path": "tests-build/README.md",
    "chars": 406,
    "preview": "Tests the various combination of feature flags. This is broken out to a separate\ncrate to work around limitations with c"
  },
  {
    "path": "tests-build/src/lib.rs",
    "chars": 41,
    "preview": "#[cfg(feature = \"tokio\")]\npub use tokio;\n"
  },
  {
    "path": "tests-build/tests/fail/macros_core_no_default.rs",
    "chars": 74,
    "preview": "use tests_build::tokio;\n\n#[tokio::main]\nasync fn my_fn() {}\n\nfn main() {}\n"
  },
  {
    "path": "tests-build/tests/fail/macros_core_no_default.stderr",
    "chars": 318,
    "preview": "error: The default runtime flavor is `multi_thread`, but the `rt-multi-thread` feature is disabled.\n --> $DIR/macros_cor"
  },
  {
    "path": "tests-build/tests/fail/macros_dead_code.rs",
    "chars": 91,
    "preview": "#![deny(dead_code)]\n\nuse tests_build::tokio;\n\n#[tokio::main]\nasync fn f() {}\n\nfn main() {}\n"
  },
  {
    "path": "tests-build/tests/fail/macros_dead_code.stderr",
    "chars": 233,
    "preview": "error: function `f` is never used\n --> $DIR/macros_dead_code.rs:6:10\n  |\n6 | async fn f() {}\n  |          ^\n  |\nnote: th"
  },
  {
    "path": "tests-build/tests/fail/macros_invalid_input.rs",
    "chars": 1683,
    "preview": "#![deny(duplicate_macro_attributes)]\n\nuse tests_build::tokio;\n\n#[tokio::main]\nfn main_is_not_async() {}\n\n#[tokio::main(f"
  },
  {
    "path": "tests-build/tests/fail/macros_invalid_input.stderr",
    "chars": 4592,
    "preview": "error: the `async` keyword is missing from the function declaration\n --> tests/fail/macros_invalid_input.rs:6:1\n  |\n6 | "
  },
  {
    "path": "tests-build/tests/fail/macros_join.rs",
    "chars": 1009,
    "preview": "use tests_build::tokio;\n\n#[tokio::main]\nasync fn main() {\n    // do not leak `RotatorSelect`\n    let _ = tokio::join!(as"
  },
  {
    "path": "tests-build/tests/fail/macros_join.stderr",
    "chars": 1698,
    "preview": "error[E0405]: cannot find trait `RotatorSelect` in this scope\n --> tests/fail/macros_join.rs:7:24\n  |\n7 |         fn foo"
  },
  {
    "path": "tests-build/tests/fail/macros_try_join.rs",
    "chars": 1033,
    "preview": "use tests_build::tokio;\n\n#[tokio::main]\nasync fn main() {\n    // do not leak `RotatorSelect`\n    let _ = tokio::try_join"
  },
  {
    "path": "tests-build/tests/fail/macros_try_join.stderr",
    "chars": 1738,
    "preview": "error[E0405]: cannot find trait `RotatorSelect` in this scope\n --> tests/fail/macros_try_join.rs:7:24\n  |\n7 |         fn"
  },
  {
    "path": "tests-build/tests/fail/macros_type_mismatch.rs",
    "chars": 1874,
    "preview": "use tests_build::tokio;\n\n#[tokio::main]\nasync fn missing_semicolon_or_return_type() {\n    Ok(())\n}\n\n#[tokio::main]\nasync"
  },
  {
    "path": "tests-build/tests/fail/macros_type_mismatch.stderr",
    "chars": 7737,
    "preview": "error[E0271]: expected `{async block@$DIR/tests/fail/macros_type_mismatch.rs:3:1: 3:15}` to be a future that resolves to"
  },
  {
    "path": "tests-build/tests/macros.rs",
    "chars": 1037,
    "preview": "#[test]\n#[cfg_attr(miri, ignore)]\nfn compile_fail_full() {\n    let t = trybuild::TestCases::new();\n\n    #[cfg(feature = "
  },
  {
    "path": "tests-build/tests/macros_clippy.rs",
    "chars": 161,
    "preview": "#[cfg(feature = \"full\")]\n#[tokio::test]\nasync fn test_with_semicolon_without_return_type() {\n    #![deny(clippy::semicol"
  },
  {
    "path": "tests-build/tests/pass/forward_args_and_output.rs",
    "chars": 266,
    "preview": "use tests_build::tokio;\n\nfn main() {}\n\n// arguments and output type is forwarded so other macros can access them\n\n#[toki"
  },
  {
    "path": "tests-build/tests/pass/impl_trait.rs",
    "chars": 381,
    "preview": "use tests_build::tokio;\n\n#[tokio::main]\nasync fn never() -> ! {\n    loop {}\n}\n\n#[tokio::main]\nasync fn impl_trait() -> i"
  },
  {
    "path": "tests-build/tests/pass/macros_main_loop.rs",
    "chars": 236,
    "preview": "use tests_build::tokio;\n\n#[tokio::main]\nasync fn main() -> Result<(), ()> {\n    loop {\n        if !never() {\n           "
  },
  {
    "path": "tests-build/tests/pass/macros_main_return.rs",
    "chars": 97,
    "preview": "use tests_build::tokio;\n\n#[tokio::main]\nasync fn main() -> Result<(), ()> {\n    return Ok(());\n}\n"
  },
  {
    "path": "tests-build/tests/pass/use_builder_outer.rs",
    "chars": 132,
    "preview": "#![deny(unused_qualifications)]\n\nuse tests_build::tokio;\npub use tokio::runtime;\n\n#[tokio::main]\nasync fn main() {\n    i"
  },
  {
    "path": "tests-integration/Cargo.toml",
    "chars": 1389,
    "preview": "[package]\nname = \"tests-integration\"\nversion = \"0.1.0\"\nauthors = [\"Tokio Contributors <team@tokio.rs>\"]\nedition = \"2021\""
  },
  {
    "path": "tests-integration/README.md",
    "chars": 70,
    "preview": "Tests that require additional components than just the `tokio` crate.\n"
  },
  {
    "path": "tests-integration/src/bin/test-cat.rs",
    "chars": 464,
    "preview": "//! A cat-like utility that can be used as a subprocess to test I/O\n//! stream communication.\n\nuse std::io;\nuse std::io:"
  },
  {
    "path": "tests-integration/src/bin/test-mem.rs",
    "chars": 524,
    "preview": "use std::future::poll_fn;\n\nfn main() {\n    let rt = tokio::runtime::Builder::new_multi_thread()\n        .worker_threads("
  },
  {
    "path": "tests-integration/src/bin/test-process-signal.rs",
    "chars": 244,
    "preview": "// https://github.com/tokio-rs/tokio/issues/3550\nfn main() {\n    for _ in 0..1000 {\n        let rt = tokio::runtime::Bui"
  },
  {
    "path": "tests-integration/src/lib.rs",
    "chars": 85,
    "preview": "#[cfg(feature = \"full\")]\ndoc_comment::doc_comment!(include_str!(\"../../README.md\"));\n"
  },
  {
    "path": "tests-integration/tests/macros_main.rs",
    "chars": 720,
    "preview": "#![cfg(all(feature = \"macros\", feature = \"rt-multi-thread\"))]\n\n#[tokio::main]\nasync fn basic_main() -> usize {\n    1\n}\n\n"
  },
  {
    "path": "tests-integration/tests/macros_pin.rs",
    "chars": 204,
    "preview": "use futures::executor::block_on;\n\nasync fn my_async_fn() {}\n\n#[test]\nfn pin() {\n    block_on(async {\n        let future "
  },
  {
    "path": "tests-integration/tests/macros_select.rs",
    "chars": 913,
    "preview": "#![cfg(feature = \"macros\")]\n\nuse futures::channel::oneshot;\nuse futures::executor::block_on;\nuse std::thread;\n\n#[cfg_att"
  },
  {
    "path": "tests-integration/tests/process_stdio.rs",
    "chars": 7349,
    "preview": "#![warn(rust_2018_idioms)]\n#![cfg(all(feature = \"full\", not(target_os = \"wasi\"), not(miri)))]\n\nuse tokio::io::{AsyncBufR"
  },
  {
    "path": "tests-integration/tests/rt_yield.rs",
    "chars": 709,
    "preview": "use tokio::sync::oneshot;\nuse tokio::task;\n\nasync fn spawn_send() {\n    let (tx, rx) = oneshot::channel();\n\n    let task"
  },
  {
    "path": "tokio/CHANGELOG.md",
    "chars": 169405,
    "preview": "# 1.50.0 (Mar 3rd, 2026)\n\n### Added\n\n- net: add `TcpStream::set_zero_linger` ([#7837])\n- rt: add `is_rt_shutdown_err` (["
  },
  {
    "path": "tokio/Cargo.toml",
    "chars": 5391,
    "preview": "[package]\nname = \"tokio\"\n# When releasing to crates.io:\n# - Remove path dependencies (if any)\n# - Update doc url\n#   - R"
  },
  {
    "path": "tokio/LICENSE",
    "chars": 1070,
    "preview": "MIT License\n\nCopyright (c) Tokio Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a c"
  },
  {
    "path": "tokio/README.md",
    "chars": 9347,
    "preview": "*[TokioConf 2026 program and tickets are now available!](https://tokioconf.com)*\n\n---\n\n# Tokio\n\nA runtime for writing re"
  },
  {
    "path": "tokio/docs/reactor-refactor.md",
    "chars": 9639,
    "preview": "# Refactor I/O driver\n\nDescribes changes to the I/O driver for the Tokio 0.3 release.\n\n## Goals\n\n* Support `async fn` on"
  },
  {
    "path": "tokio/fuzz/.gitignore",
    "chars": 33,
    "preview": "target\ncorpus\nartifacts\ncoverage\n"
  },
  {
    "path": "tokio/fuzz/Cargo.toml",
    "chars": 462,
    "preview": "[package]\nname = \"tokio-fuzz\"\nversion = \"0.0.0\"\npublish = false\nedition = \"2021\"\n\n[package.metadata]\ncargo-fuzz = true\n\n"
  },
  {
    "path": "tokio/fuzz/fuzz_targets/fuzz_linked_list.rs",
    "chars": 120,
    "preview": "#![no_main]\n\nuse libfuzzer_sys::fuzz_target;\n\nfuzz_target!(|data: &[u8]| {\n    tokio::fuzz::fuzz_linked_list(data);\n});\n"
  },
  {
    "path": "tokio/src/blocking.rs",
    "chars": 1577,
    "preview": "cfg_rt! {\n    pub(crate) use crate::runtime::spawn_blocking;\n\n    cfg_fs! {\n        #[allow(unused_imports)]\n        pub"
  },
  {
    "path": "tokio/src/doc/mod.rs",
    "chars": 1310,
    "preview": "//! Types which are documented locally in the Tokio crate, but does not actually\n//! live here.\n//!\n//! **Note** this mo"
  },
  {
    "path": "tokio/src/doc/os.rs",
    "chars": 4041,
    "preview": "//! See [`std::os`](https://doc.rust-lang.org/std/os/index.html).\n\n/// Platform-specific extensions to `std` for Windows"
  },
  {
    "path": "tokio/src/fs/canonicalize.rs",
    "chars": 1698,
    "preview": "use crate::fs::asyncify;\n\nuse std::io;\nuse std::path::{Path, PathBuf};\n\n/// Returns the canonical, absolute form of a pa"
  },
  {
    "path": "tokio/src/fs/copy.rs",
    "chars": 708,
    "preview": "use crate::fs::asyncify;\nuse std::path::Path;\n\n/// Copies the contents of one file to another. This function will also c"
  },
  {
    "path": "tokio/src/fs/create_dir.rs",
    "chars": 1521,
    "preview": "use crate::fs::asyncify;\n\nuse std::io;\nuse std::path::Path;\n\n/// Creates a new, empty directory at the provided path.\n//"
  },
  {
    "path": "tokio/src/fs/create_dir_all.rs",
    "chars": 1733,
    "preview": "use crate::fs::asyncify;\n\nuse std::io;\nuse std::path::Path;\n\n/// Recursively creates a directory and all of its parent c"
  },
  {
    "path": "tokio/src/fs/dir_builder.rs",
    "chars": 3542,
    "preview": "use crate::fs::asyncify;\n\nuse std::io;\nuse std::path::Path;\n\n/// A builder for creating directories in various manners.\n"
  },
  {
    "path": "tokio/src/fs/file/tests.rs",
    "chars": 23559,
    "preview": "use super::*;\nuse crate::{\n    fs::mocks::*,\n    io::{AsyncReadExt, AsyncSeekExt, AsyncWriteExt},\n};\nuse mockall::{predi"
  },
  {
    "path": "tokio/src/fs/file.rs",
    "chars": 32402,
    "preview": "//! Types for working with [`File`].\n//!\n//! [`File`]: File\n\nuse crate::fs::{asyncify, OpenOptions};\nuse crate::io::bloc"
  },
  {
    "path": "tokio/src/fs/hard_link.rs",
    "chars": 1319,
    "preview": "use crate::fs::asyncify;\n\nuse std::io;\nuse std::path::Path;\n\n/// Creates a new hard link on the filesystem.\n///\n/// This"
  },
  {
    "path": "tokio/src/fs/metadata.rs",
    "chars": 1305,
    "preview": "use crate::fs::asyncify;\n\nuse std::fs::Metadata;\nuse std::io;\nuse std::path::Path;\n\n/// Given a path, queries the file s"
  },
  {
    "path": "tokio/src/fs/mocks.rs",
    "chars": 5556,
    "preview": "//! Mock version of std::fs::File;\nuse mockall::mock;\n\nuse crate::sync::oneshot;\n#[cfg(all(test, unix))]\nuse std::os::fd"
  },
  {
    "path": "tokio/src/fs/mod.rs",
    "chars": 9375,
    "preview": "#![cfg(not(loom))]\n\n//! Asynchronous file utilities.\n//!\n//! This module contains utility methods for working with the f"
  },
  {
    "path": "tokio/src/fs/open_options/mock_open_options.rs",
    "chars": 1459,
    "preview": "#![allow(unreachable_pub)]\n//! Mock version of `std::fs::OpenOptions`;\nuse mockall::mock;\n\nuse crate::fs::mocks::MockFil"
  },
  {
    "path": "tokio/src/fs/open_options/uring_open_options.rs",
    "chars": 3951,
    "preview": "use std::io;\n\n#[cfg(not(test))]\nuse std::os::unix::fs::OpenOptionsExt;\n\n#[cfg(test)]\nuse super::mock_open_options::MockO"
  },
  {
    "path": "tokio/src/fs/open_options.rs",
    "chars": 28847,
    "preview": "use crate::fs::{asyncify, File};\n\nuse std::io;\nuse std::path::Path;\n\ncfg_io_uring! {\n    mod uring_open_options;\n    pub"
  },
  {
    "path": "tokio/src/fs/read.rs",
    "chars": 2581,
    "preview": "use crate::fs::asyncify;\n\nuse std::{io, path::Path};\n\n/// Reads the entire contents of a file into a bytes vector.\n///\n/"
  },
  {
    "path": "tokio/src/fs/read_dir.rs",
    "chars": 11062,
    "preview": "use crate::fs::asyncify;\n\nuse std::collections::VecDeque;\nuse std::ffi::OsString;\nuse std::fs::{FileType, Metadata};\nuse"
  },
  {
    "path": "tokio/src/fs/read_link.rs",
    "chars": 371,
    "preview": "use crate::fs::asyncify;\n\nuse std::io;\nuse std::path::{Path, PathBuf};\n\n/// Reads a symbolic link, returning the file th"
  },
  {
    "path": "tokio/src/fs/read_to_string.rs",
    "chars": 916,
    "preview": "use crate::fs::asyncify;\n\nuse std::{io, path::Path};\n\n/// Creates a future which will open a file for reading and read t"
  },
  {
    "path": "tokio/src/fs/read_uring.rs",
    "chars": 4227,
    "preview": "use crate::fs::OpenOptions;\nuse crate::runtime::driver::op::Op;\n\nuse std::io;\nuse std::io::ErrorKind;\nuse std::os::fd::O"
  },
  {
    "path": "tokio/src/fs/remove_dir.rs",
    "chars": 329,
    "preview": "use crate::fs::asyncify;\n\nuse std::io;\nuse std::path::Path;\n\n/// Removes an existing, empty directory.\n///\n/// This is a"
  },
  {
    "path": "tokio/src/fs/remove_dir_all.rs",
    "chars": 431,
    "preview": "use crate::fs::asyncify;\n\nuse std::io;\nuse std::path::Path;\n\n/// Removes a directory at this path, after removing all it"
  },
  {
    "path": "tokio/src/fs/remove_file.rs",
    "chars": 504,
    "preview": "use crate::fs::asyncify;\n\nuse std::io;\nuse std::path::Path;\n\n/// Removes a file from the filesystem.\n///\n/// Note that t"
  },
  {
    "path": "tokio/src/fs/rename.rs",
    "chars": 516,
    "preview": "use crate::fs::asyncify;\n\nuse std::io;\nuse std::path::Path;\n\n/// Renames a file or directory to a new name, replacing th"
  },
  {
    "path": "tokio/src/fs/set_permissions.rs",
    "chars": 455,
    "preview": "use crate::fs::asyncify;\n\nuse std::fs::Permissions;\nuse std::io;\nuse std::path::Path;\n\n/// Changes the permissions found"
  },
  {
    "path": "tokio/src/fs/symlink.rs",
    "chars": 518,
    "preview": "use crate::fs::asyncify;\n\nuse std::io;\nuse std::path::Path;\n\n/// Creates a new symbolic link on the filesystem.\n///\n/// "
  },
  {
    "path": "tokio/src/fs/symlink_dir.rs",
    "chars": 637,
    "preview": "use crate::fs::asyncify;\n\nuse std::io;\nuse std::path::Path;\n\n/// Creates a new directory symlink on the filesystem.\n///\n"
  },
  {
    "path": "tokio/src/fs/symlink_file.rs",
    "chars": 637,
    "preview": "use crate::fs::asyncify;\n\nuse std::io;\nuse std::path::Path;\n\n/// Creates a new file symbolic link on the filesystem.\n///"
  },
  {
    "path": "tokio/src/fs/symlink_metadata.rs",
    "chars": 426,
    "preview": "use crate::fs::asyncify;\n\nuse std::fs::Metadata;\nuse std::io;\nuse std::path::Path;\n\n/// Queries the file system metadata"
  },
  {
    "path": "tokio/src/fs/try_exists.rs",
    "chars": 749,
    "preview": "use crate::fs::asyncify;\n\nuse std::io;\nuse std::path::Path;\n\n/// Returns `Ok(true)` if the path points at an existing en"
  },
  {
    "path": "tokio/src/fs/write.rs",
    "chars": 2676,
    "preview": "use crate::{fs::asyncify, util::as_ref::OwnedBuf};\n\nuse std::{io, path::Path};\n\n/// Creates a future that will open a fi"
  },
  {
    "path": "tokio/src/future/block_on.rs",
    "chars": 693,
    "preview": "use std::future::Future;\n\ncfg_rt! {\n    #[track_caller]\n    pub(crate) fn block_on<F: Future>(f: F) -> F::Output {\n     "
  },
  {
    "path": "tokio/src/future/maybe_done.rs",
    "chars": 3811,
    "preview": "//! Definition of the [`MaybeDone`] combinator.\n\nuse pin_project_lite::pin_project;\nuse std::future::{Future, IntoFuture"
  },
  {
    "path": "tokio/src/future/mod.rs",
    "chars": 517,
    "preview": "#![cfg_attr(not(feature = \"macros\"), allow(unreachable_pub))]\n\n//! Asynchronous values.\n\n#[cfg(any(feature = \"macros\", f"
  },
  {
    "path": "tokio/src/future/trace.rs",
    "chars": 269,
    "preview": "use std::future::Future;\n\npub(crate) trait InstrumentedFuture: Future {\n    fn id(&self) -> Option<tracing::Id>;\n}\n\nimpl"
  },
  {
    "path": "tokio/src/future/try_join.rs",
    "chars": 2321,
    "preview": "use crate::future::maybe_done::{maybe_done, MaybeDone};\n\nuse pin_project_lite::pin_project;\nuse std::future::Future;\nuse"
  },
  {
    "path": "tokio/src/fuzz.rs",
    "chars": 59,
    "preview": "pub use crate::util::linked_list::tests::fuzz_linked_list;\n"
  },
  {
    "path": "tokio/src/io/async_buf_read.rs",
    "chars": 4361,
    "preview": "use crate::io::AsyncRead;\n\nuse std::io;\nuse std::ops::DerefMut;\nuse std::pin::Pin;\nuse std::task::{Context, Poll};\n\n/// "
  },
  {
    "path": "tokio/src/io/async_fd.rs",
    "chars": 58977,
    "preview": "use crate::io::{Interest, Ready};\nuse crate::runtime::io::{ReadyEvent, Registration};\nuse crate::runtime::scheduler;\n\nus"
  },
  {
    "path": "tokio/src/io/async_read.rs",
    "chars": 4502,
    "preview": "use super::ReadBuf;\nuse std::io;\nuse std::ops::DerefMut;\nuse std::pin::Pin;\nuse std::task::{Context, Poll};\n\n/// Reads b"
  },
  {
    "path": "tokio/src/io/async_seek.rs",
    "chars": 3524,
    "preview": "use std::io::{self, SeekFrom};\nuse std::ops::DerefMut;\nuse std::pin::Pin;\nuse std::task::{Context, Poll};\n\n/// Seek byte"
  },
  {
    "path": "tokio/src/io/async_write.rs",
    "chars": 14187,
    "preview": "use std::io::{self, IoSlice};\nuse std::ops::DerefMut;\nuse std::pin::Pin;\nuse std::task::{Context, Poll};\n\n/// Writes byt"
  },
  {
    "path": "tokio/src/io/blocking.rs",
    "chars": 9038,
    "preview": "use crate::io::sys;\nuse crate::io::{AsyncRead, AsyncWrite, ReadBuf};\n\nuse std::cmp;\nuse std::future::Future;\nuse std::io"
  },
  {
    "path": "tokio/src/io/bsd/poll_aio.rs",
    "chars": 7398,
    "preview": "//! Use POSIX AIO futures with Tokio.\n\nuse crate::io::interest::Interest;\nuse crate::runtime::io::{ReadyEvent, Registrat"
  },
  {
    "path": "tokio/src/io/interest.rs",
    "chars": 10232,
    "preview": "#![cfg_attr(not(feature = \"net\"), allow(dead_code, unreachable_pub))]\n\nuse crate::io::ready::Ready;\n\nuse std::fmt;\nuse s"
  },
  {
    "path": "tokio/src/io/join.rs",
    "chars": 3217,
    "preview": "//! Join two values implementing `AsyncRead` and `AsyncWrite` into a single one.\n\nuse crate::io::{AsyncBufRead, AsyncRea"
  },
  {
    "path": "tokio/src/io/mod.rs",
    "chars": 10582,
    "preview": "//! Traits, helpers, and type definitions for asynchronous I/O functionality.\n//!\n//! This module is the asynchronous ve"
  },
  {
    "path": "tokio/src/io/poll_evented.rs",
    "chars": 13237,
    "preview": "use crate::io::interest::Interest;\nuse crate::runtime::io::Registration;\nuse crate::runtime::scheduler;\n\nuse mio::event:"
  },
  {
    "path": "tokio/src/io/read_buf.rs",
    "chars": 12495,
    "preview": "use std::fmt;\nuse std::mem::MaybeUninit;\n\n/// A wrapper around a byte buffer that is incrementally filled and initialize"
  },
  {
    "path": "tokio/src/io/ready.rs",
    "chars": 9200,
    "preview": "#![cfg_attr(not(feature = \"net\"), allow(unreachable_pub))]\n\nuse crate::io::interest::Interest;\n\nuse std::fmt;\nuse std::o"
  },
  {
    "path": "tokio/src/io/seek.rs",
    "chars": 1587,
    "preview": "use crate::io::AsyncSeek;\n\nuse pin_project_lite::pin_project;\nuse std::future::Future;\nuse std::io::{self, SeekFrom};\nus"
  },
  {
    "path": "tokio/src/io/split.rs",
    "chars": 4693,
    "preview": "//! Split a single value implementing `AsyncRead + AsyncWrite` into separate\n//! `AsyncRead` and `AsyncWrite` handles.\n/"
  },
  {
    "path": "tokio/src/io/stderr.rs",
    "chars": 4539,
    "preview": "use crate::io::blocking::Blocking;\nuse crate::io::stdio_common::SplitByUtf8BoundaryIfWindows;\nuse crate::io::AsyncWrite;"
  },
  {
    "path": "tokio/src/io/stdin.rs",
    "chars": 3089,
    "preview": "use crate::io::blocking::Blocking;\nuse crate::io::{AsyncRead, ReadBuf};\n\nuse std::io;\nuse std::pin::Pin;\nuse std::task::"
  },
  {
    "path": "tokio/src/io/stdio_common.rs",
    "chars": 7773,
    "preview": "//! Contains utilities for stdout and stderr.\nuse crate::io::AsyncWrite;\nuse std::pin::Pin;\nuse std::task::{Context, Pol"
  },
  {
    "path": "tokio/src/io/stdout.rs",
    "chars": 6424,
    "preview": "use crate::io::blocking::Blocking;\nuse crate::io::stdio_common::SplitByUtf8BoundaryIfWindows;\nuse crate::io::AsyncWrite;"
  },
  {
    "path": "tokio/src/io/uring/mod.rs",
    "chars": 86,
    "preview": "pub(crate) mod open;\npub(crate) mod read;\npub(crate) mod utils;\npub(crate) mod write;\n"
  },
  {
    "path": "tokio/src/io/uring/open.rs",
    "chars": 1699,
    "preview": "use super::utils::cstr;\n\nuse crate::fs::UringOpenOptions;\nuse crate::runtime::driver::op::{CancelData, Cancellable, Comp"
  },
  {
    "path": "tokio/src/io/uring/read.rs",
    "chars": 1910,
    "preview": "use crate::runtime::driver::op::{CancelData, Cancellable, Completable, CqeResult, Op};\n\nuse io_uring::{opcode, types};\nu"
  },
  {
    "path": "tokio/src/io/uring/utils.rs",
    "chars": 180,
    "preview": "use std::os::unix::ffi::OsStrExt;\nuse std::{ffi::CString, io, path::Path};\n\npub(crate) fn cstr(p: &Path) -> io::Result<C"
  },
  {
    "path": "tokio/src/io/uring/write.rs",
    "chars": 1660,
    "preview": "use crate::runtime::driver::op::{CancelData, Cancellable, Completable, CqeResult, Op};\nuse crate::util::as_ref::OwnedBuf"
  },
  {
    "path": "tokio/src/io/util/async_buf_read_ext.rs",
    "chars": 14055,
    "preview": "use crate::io::util::fill_buf::{fill_buf, FillBuf};\nuse crate::io::util::lines::{lines, Lines};\nuse crate::io::util::rea"
  },
  {
    "path": "tokio/src/io/util/async_read_ext.rs",
    "chars": 53714,
    "preview": "use crate::io::util::chain::{chain, Chain};\nuse crate::io::util::read::{read, Read};\nuse crate::io::util::read_buf::{rea"
  },
  {
    "path": "tokio/src/io/util/async_seek_ext.rs",
    "chars": 2875,
    "preview": "use crate::io::seek::{seek, Seek};\nuse crate::io::AsyncSeek;\nuse std::io::SeekFrom;\n\ncfg_io_util! {\n    /// An extension"
  },
  {
    "path": "tokio/src/io/util/async_write_ext.rs",
    "chars": 47468,
    "preview": "use crate::io::util::flush::{flush, Flush};\nuse crate::io::util::shutdown::{shutdown, Shutdown};\nuse crate::io::util::wr"
  },
  {
    "path": "tokio/src/io/util/buf_reader.rs",
    "chars": 11649,
    "preview": "use crate::io::util::DEFAULT_BUF_SIZE;\nuse crate::io::{AsyncBufRead, AsyncRead, AsyncSeek, AsyncWrite, ReadBuf};\n\nuse pi"
  },
  {
    "path": "tokio/src/io/util/buf_stream.rs",
    "chars": 6705,
    "preview": "use crate::io::util::{BufReader, BufWriter};\nuse crate::io::{AsyncBufRead, AsyncRead, AsyncSeek, AsyncWrite, ReadBuf};\n\n"
  },
  {
    "path": "tokio/src/io/util/buf_writer.rs",
    "chars": 10500,
    "preview": "use crate::io::util::DEFAULT_BUF_SIZE;\nuse crate::io::{AsyncBufRead, AsyncRead, AsyncSeek, AsyncWrite, ReadBuf};\n\nuse pi"
  },
  {
    "path": "tokio/src/io/util/chain.rs",
    "chars": 3541,
    "preview": "use crate::io::{AsyncBufRead, AsyncRead, ReadBuf};\n\nuse pin_project_lite::pin_project;\nuse std::fmt;\nuse std::io;\nuse st"
  },
  {
    "path": "tokio/src/io/util/copy.rs",
    "chars": 10439,
    "preview": "use crate::io::{AsyncRead, AsyncWrite, ReadBuf};\n\nuse std::future::Future;\nuse std::io;\nuse std::pin::Pin;\nuse std::task"
  },
  {
    "path": "tokio/src/io/util/copy_bidirectional.rs",
    "chars": 4426,
    "preview": "use super::copy::CopyBuffer;\n\nuse crate::io::{AsyncRead, AsyncWrite};\n\nuse std::future::poll_fn;\nuse std::io;\nuse std::p"
  },
  {
    "path": "tokio/src/io/util/copy_buf.rs",
    "chars": 3801,
    "preview": "use crate::io::{AsyncBufRead, AsyncWrite};\nuse std::future::Future;\nuse std::io;\nuse std::pin::Pin;\nuse std::task::{read"
  },
  {
    "path": "tokio/src/io/util/empty.rs",
    "chars": 4612,
    "preview": "use crate::io::util::poll_proceed_and_make_progress;\nuse crate::io::{AsyncBufRead, AsyncRead, AsyncSeek, AsyncWrite, Rea"
  },
  {
    "path": "tokio/src/io/util/fill_buf.rs",
    "chars": 2004,
    "preview": "use crate::io::AsyncBufRead;\n\nuse pin_project_lite::pin_project;\nuse std::future::Future;\nuse std::io;\nuse std::marker::"
  },
  {
    "path": "tokio/src/io/util/flush.rs",
    "chars": 1162,
    "preview": "use crate::io::AsyncWrite;\n\nuse pin_project_lite::pin_project;\nuse std::future::Future;\nuse std::io;\nuse std::marker::Ph"
  },
  {
    "path": "tokio/src/io/util/lines.rs",
    "chars": 3966,
    "preview": "use crate::io::util::read_line::read_line_internal;\nuse crate::io::AsyncBufRead;\n\nuse pin_project_lite::pin_project;\nuse"
  },
  {
    "path": "tokio/src/io/util/mem.rs",
    "chars": 13148,
    "preview": "//! In-process memory IO types.\n\nuse crate::io::{split, AsyncRead, AsyncWrite, ReadBuf, ReadHalf, WriteHalf};\nuse crate:"
  },
  {
    "path": "tokio/src/io/util/mod.rs",
    "chars": 2401,
    "preview": "#![allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411\n\ncfg_io_util! {\n    mod async_buf_read_ext;"
  },
  {
    "path": "tokio/src/io/util/read.rs",
    "chars": 1568,
    "preview": "use crate::io::{AsyncRead, ReadBuf};\n\nuse pin_project_lite::pin_project;\nuse std::future::Future;\nuse std::io;\nuse std::"
  },
  {
    "path": "tokio/src/io/util/read_buf.rs",
    "chars": 1862,
    "preview": "use crate::io::AsyncRead;\n\nuse bytes::BufMut;\nuse pin_project_lite::pin_project;\nuse std::future::Future;\nuse std::io;\nu"
  },
  {
    "path": "tokio/src/io/util/read_exact.rs",
    "chars": 1985,
    "preview": "use crate::io::{AsyncRead, ReadBuf};\n\nuse pin_project_lite::pin_project;\nuse std::future::Future;\nuse std::io;\nuse std::"
  }
]

// ... and 642 more files (download for full content)

About this extraction

This page contains the full source code of the tokio-rs/tokio GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 842 files (5.5 MB), approximately 1.5M tokens, and a symbol index with 7948 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!