Quellcodebibliothek Statistik Leitseite products/sources/formale Sprachen/C/Firefox/third_party/rust/range-map/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 493 B image not shown  

Quellcode-Bibliothek stream_pending.rs   Sprache: unbekannt

 
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());
    }
}

[ 0.12Quellennavigators  Projekt   ]