mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-25 12:00:35 +00:00

This change removes all references to `Stream` from within the `tokio` crate and moves them into a new `tokio-stream` crate. Most types have had their `impl Stream` removed as well in-favor of their inherent methods. Closes #2870
15 lines
369 B
Rust
15 lines
369 B
Rust
use tokio_stream::{self as stream, Stream, StreamExt};
|
|
use tokio_test::{assert_pending, task};
|
|
|
|
#[tokio::test]
|
|
async fn basic_usage() {
|
|
let mut stream = stream::pending::<i32>();
|
|
|
|
for _ in 0..2 {
|
|
assert_eq!(stream.size_hint(), (0, None));
|
|
|
|
let mut next = task::spawn(async { stream.next().await });
|
|
assert_pending!(next.poll());
|
|
}
|
|
}
|