A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
2682 matches across 8 categories. Click a row to expand file-level details.
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tokio-stream/src/pending.rs | 21 | /// immediately empty but returns no values. |
| LOW | tokio-stream/src/empty.rs | 21 | /// |
| LOW | tokio-stream/src/lib.rs | 21 | //! an asynchronous version of the standard library's `Iterator` trait. |
| LOW | tokio-stream/src/lib.rs | 41 | //! while let Some(value) = stream.next().await { |
| LOW | tokio-stream/src/lib.rs | 61 | //! The opposite conversion from an [`AsyncRead`] into a `Stream` is also |
| LOW | tokio-stream/src/iter.rs | 21 | /// |
| LOW | tokio-stream/src/stream_close.rs | 1 | use crate::Stream; |
| LOW | tokio-stream/src/stream_close.rs | 21 | /// # async fn main() { |
| LOW | tokio-stream/src/stream_ext.rs | 81 | /// |
| LOW | tokio-stream/src/stream_ext.rs | 101 | /// ``` |
| LOW | tokio-stream/src/stream_ext.rs | 121 | /// crate. |
| LOW | tokio-stream/src/stream_ext.rs | 141 | /// assert_eq!(stream.next().await, None); |
| LOW | tokio-stream/src/stream_ext.rs | 161 | /// but returns a [`Result<Option<T>, E>`](Result) rather than |
| LOW | tokio-stream/src/stream_ext.rs | 181 | /// assert_eq!(stream.try_next().await, Ok(Some(1))); |
| LOW | tokio-stream/src/stream_ext.rs | 201 | /// wrapped version of it, similar to the existing `map` methods in the |
| LOW | tokio-stream/src/stream_ext.rs | 221 | F: FnMut(Self::Item) -> T, |
| LOW | tokio-stream/src/stream_ext.rs | 241 | /// |
| LOW | tokio-stream/src/stream_ext.rs | 261 | fn map_while<T, F>(self, f: F) -> MapWhile<Self, F> |
| LOW | tokio-stream/src/stream_ext.rs | 281 | /// returned by this method. To handle this, you can use `tokio::pin!` as in |
| LOW | tokio-stream/src/stream_ext.rs | 301 | /// assert_eq!(stream.next().await, Some(5)); |
| LOW | tokio-stream/src/stream_ext.rs | 321 | /// will break the fairness of the merging. |
| LOW | tokio-stream/src/stream_ext.rs | 341 | /// # /* |
| LOW | tokio-stream/src/stream_ext.rs | 361 | /// }) as Pin<Box<dyn Stream<Item = usize> + Send>>; |
| LOW | tokio-stream/src/stream_ext.rs | 381 | /// |
| LOW | tokio-stream/src/stream_ext.rs | 401 | Self: Sized, |
| LOW | tokio-stream/src/stream_ext.rs | 421 | /// ``` |
| LOW | tokio-stream/src/stream_ext.rs | 441 | Filter::new(self, f) |
| LOW | tokio-stream/src/stream_ext.rs | 461 | /// |
| LOW | tokio-stream/src/stream_ext.rs | 481 | |
| LOW | tokio-stream/src/stream_ext.rs | 501 | /// |
| LOW | tokio-stream/src/stream_ext.rs | 521 | /// # #[tokio::main(flavor = "current_thread")] |
| LOW | tokio-stream/src/stream_ext.rs | 541 | /// } |
| LOW | tokio-stream/src/stream_ext.rs | 561 | /// |
| LOW | tokio-stream/src/stream_ext.rs | 581 | /// stream until the predicate `f` resolves to `false`. Once one element |
| LOW | tokio-stream/src/stream_ext.rs | 601 | F: FnMut(&Self::Item) -> bool, |
| LOW | tokio-stream/src/stream_ext.rs | 621 | /// assert_eq!(Some(10), stream.next().await); |
| LOW | tokio-stream/src/stream_ext.rs | 641 | /// # Examples |
| LOW | tokio-stream/src/stream_ext.rs | 661 | } |
| LOW | tokio-stream/src/stream_ext.rs | 681 | /// |
| LOW | tokio-stream/src/stream_ext.rs | 701 | /// ``` |
| LOW | tokio-stream/src/stream_ext.rs | 721 | AllFuture::new(self, f) |
| LOW | tokio-stream/src/stream_ext.rs | 741 | /// An empty stream returns `false`. |
| LOW | tokio-stream/src/stream_ext.rs | 761 | /// # #[tokio::main(flavor = "current_thread")] |
| LOW | tokio-stream/src/stream_ext.rs | 781 | } |
| LOW | tokio-stream/src/stream_ext.rs | 801 | /// assert_eq!(stream.next().await, Some(1)); |
| LOW | tokio-stream/src/stream_ext.rs | 821 | /// Equivalent to: |
| LOW | tokio-stream/src/stream_ext.rs | 841 | where |
| LOW | tokio-stream/src/stream_ext.rs | 861 | /// |
| LOW | tokio-stream/src/stream_ext.rs | 881 | /// # #[tokio::main(flavor = "current_thread")] |
| LOW | tokio-stream/src/stream_ext.rs | 901 | /// let values: Result<Vec<i32>, &str> = |
| LOW | tokio-stream/src/stream_ext.rs | 921 | T: FromStream<Self::Item>, |
| LOW | tokio-stream/src/stream_ext.rs | 941 | /// This function consumes the stream passed into it and returns a |
| LOW | tokio-stream/src/stream_ext.rs | 961 | /// // When no items time out, we get the 3 elements in succession: |
| LOW | tokio-stream/src/stream_ext.rs | 981 | /// assert_eq!(int_stream.try_next().await, Ok(None)); |
| LOW | tokio-stream/src/stream_ext.rs | 1001 | /// # } |
| LOW | tokio-stream/src/stream_ext.rs | 1021 | /// becomes available before the deadline is reached, additional errors are |
| LOW | tokio-stream/src/stream_ext.rs | 1041 | /// use std::time::Duration; |
| LOW | tokio-stream/src/stream_ext.rs | 1061 | /// // If we want to stop consuming the source stream the first time an |
| LOW | tokio-stream/src/stream_ext.rs | 1081 | /// tokio::pin!(timeout_stream); |
| LOW | tokio-stream/src/stream_ext.rs | 1101 | /// |
| 2554 more matches not shown… | |||
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | tokio-stream/tests/stream_fused.rs | 9 | // ── map ────────────────────────────────────────────────────────────────────── |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 25 | // ── filter ─────────────────────────────────────────────────────────────────── |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 41 | // ── filter_map ─────────────────────────────────────────────────────────────── |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 57 | // ── skip ───────────────────────────────────────────────────────────────────── |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 73 | // ── skip_while ─────────────────────────────────────────────────────────────── |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 89 | // ── take ───────────────────────────────────────────────────────────────────── |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 114 | // ── take_while ─────────────────────────────────────────────────────────────── |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 132 | // ── then ───────────────────────────────────────────────────────────────────── |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 151 | // ── chain ──────────────────────────────────────────────────────────────────── |
| MEDIUM | tokio-stream/tests/stream_fused.rs | 169 | // ── merge ──────────────────────────────────────────────────────────────────── |
| MEDIUM | tokio-util/src/codec/framed_impl.rs | 144 | // ┌────────────────────────────────────────────────────────┐ |
| MEDIUM | tokio-util/src/codec/framed_impl.rs | 147 | // ┌─────┐ │ `decode_eof` returns After returning │ |
| MEDIUM | tokio-util/src/codec/framed_impl.rs | 148 | // Read 0 bytes ├─────▼──┴┐ `Ok(None)` ┌────────┐ ◄───┐ `None` ┌───▼─────┐ |
| MEDIUM | tokio-util/src/codec/framed_impl.rs | 149 | // ┌────────────────►│ Pausing ├───────────────────────►│ Paused ├─┐ └───────────┤ Errored │ |
| MEDIUM | tokio-util/src/codec/framed_impl.rs | 150 | // │ └─────────┘ └─┬──▲───┘ │ └───▲───▲─┘ |
| MEDIUM | tokio-util/src/codec/framed_impl.rs | 152 | // ┌──────┐ │ `decode` returns `Some` │ └─────┘ │ │ |
| MEDIUM | tokio-util/src/codec/framed_impl.rs | 153 | // │ │ │ ┌──────┐ │ Pending │ │ |
| MEDIUM | tokio-util/src/codec/framed_impl.rs | 154 | // │ ┌────▼──┴─┐ Read n>0 bytes ┌┴──────▼─┐ read n>0 bytes │ read │ │ |
| MEDIUM | tokio-util/src/codec/framed_impl.rs | 155 | // └─┤ Reading ├───────────────►│ Framing │◄────────────────────────┘ │ │ |
| MEDIUM | tokio-util/src/codec/framed_impl.rs | 156 | // └──┬─▲────┘ └─────┬──┬┘ │ │ |
| MEDIUM | tokio-util/src/codec/framed_impl.rs | 158 | // │ └───decode` returns `None`──┘ └───────────────────────────────────────────────────────┘ │ |
| MEDIUM | tokio-util/src/codec/framed_impl.rs | 160 | // └────────────────────────────────────────────────────────────────────────────────────────────┘ |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tokio/src/net/udp.rs | 511 | /// # Return value |
| LOW | tokio/src/net/udp.rs | 587 | /// # Return value |
| LOW | tokio/src/net/udp.rs | 736 | /// # Return value |
| LOW | tokio/src/net/udp.rs | 807 | /// # Return value |
| LOW | tokio/src/net/udp.rs | 1203 | /// # Return value |
| LOW | tokio/src/net/udp.rs | 1341 | /// # Return value |
| LOW | tokio/src/net/udp.rs | 1601 | /// # Return value |
| LOW | tokio/src/net/udp.rs | 1746 | /// # Return value |
| LOW | tokio/src/net/unix/stream.rs | 254 | /// # Return value |
| LOW | tokio/src/net/unix/stream.rs | 570 | /// # Return value |
| LOW | tokio/src/net/unix/pipe.rs | 585 | /// # Return value |
| LOW | tokio/src/net/unix/pipe.rs | 1137 | /// # Return value |
| LOW | tokio/src/net/unix/datagram/socket.rs | 260 | /// # Return value |
| LOW | tokio/src/net/unix/datagram/socket.rs | 356 | /// # Return value |
| LOW | tokio/src/net/unix/datagram/socket.rs | 1168 | /// # Return value |
| LOW | tokio/src/net/unix/datagram/socket.rs | 1208 | /// # Return value |
| LOW | tokio/src/net/unix/datagram/socket.rs | 1243 | /// # Return value |
| LOW | tokio/src/net/unix/datagram/socket.rs | 1272 | /// # Return value |
| LOW | tokio/src/net/tcp/stream.rs | 335 | /// # Return value |
| LOW | tokio/src/net/tcp/stream.rs | 543 | /// # Return value |
| LOW | tokio/src/net/tcp/stream.rs | 855 | /// # Return value |
| LOW | tokio/src/net/windows/named_pipe.rs | 375 | /// # Return value |
| LOW | tokio/src/net/windows/named_pipe.rs | 682 | /// # Return value |
| LOW | tokio/src/net/windows/named_pipe.rs | 1169 | /// # Return value |
| LOW | tokio/src/net/windows/named_pipe.rs | 1473 | /// # Return value |
| LOW | tokio/src/io/async_write.rs | 95 | /// # Return value |
| LOW | tokio/src/io/util/copy_bidirectional.rs | 71 | /// # Return value |
| LOW | tokio/src/sync/oneshot.rs | 793 | /// # Return value |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | tokio-util/src/io/sync_bridge.rs | 16 | /// might not fully leverage the async capabilities of the system. |
| MEDIUM | tokio-util/src/io/sync_bridge.rs | 121 | /// blocking and inefficient code. Instead, you can utilize an async compression library |
| MEDIUM | tokio/src/runtime/time_alt/entry.rs | 83 | /// An ZST to allow [`super::registration_queue`] to utilize the [`Entry::extra_pointers`] |
| MEDIUM | tokio/src/runtime/time_alt/entry.rs | 114 | /// An ZST to allow [`super::cancellation_queue`] to utilize the [`Entry::cancel_pointers`] |
| MEDIUM | tokio/src/runtime/time_alt/entry.rs | 145 | /// An ZST to allow [`super::WakeQueue`] to utilize the [`Entry::extra_pointers`] |
| MEDIUM | tokio/src/runtime/task/trace/tree.rs | 14 | /// There should only be one root, but the code is robust to multiple roots. |
| MEDIUM | tokio/src/sync/semaphore.rs | 200 | /// work, but it doesn't matter which test runs first. We can leverage a |
| MEDIUM | tokio/src/sync/mod.rs | 129 | //! given time. Properly setting this value is key in implementing robust |
| MEDIUM | tokio/src/process/mod.rs | 662 | /// a [`Child`] handle where possible, and instead utilize `child.wait().await` |
| MEDIUM | examples/print_each_packet.rs | 89 | // Essentially here we're executing a new task to run concurrently, |
| MEDIUM | examples/echo-tcp.rs | 57 | // Essentially here we're executing a new task to run concurrently, |
| Severity | File | Line | Snippet |
|---|---|---|---|
| CRITICAL | tokio/src/runtime/scheduler/multi_thread/worker.rs | 634 | let task = self.worker.handle.shared.owned.assert_owner(task); |
| CRITICAL | tokio/src/runtime/scheduler/multi_thread/worker.rs | 750 | let task = self.worker.handle.shared.owned.assert_owner(task); |
| Severity | File | Line | Snippet |
|---|---|---|---|
| HIGH | tokio/src/runtime/metrics/histogram/h2_histogram.rs | 251 | // this by one to ensure we are at least as granular as requested. |
| Severity | File | Line | Snippet |
|---|---|---|---|
| MEDIUM | tokio-util/src/codec/length_delimited.rs | 366 | //! Here is a simple example, given a `FramedWrite` with the following |
| LOW | examples/udp-client.rs | 24 | //! Don't forget to pass `EOF` to the standard input of the client! |
| Severity | File | Line | Snippet |
|---|---|---|---|
| LOW | tokio/src/runtime/dump.rs | 237 | /// Example usage: |
| LOW | tokio/src/macros/cfg.rs | 8 | /// ## Example usage: |