Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/tokio-stream/tests/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 312 B image not shown  

Quelle  stream_once.rs   Sprache: unbekannt

 
use tokio_stream::{self as stream, Stream, StreamExt};

#[tokio::test]
async fn basic_usage() {
    let mut one = stream::once(1);

    assert_eq!(one.size_hint(), (1, Some(1)));
    assert_eq!(Some(1), one.next().await);

    assert_eq!(one.size_hint(), (0, Some(0)));
    assert_eq!(None, one.next().await);
}

[ Dauer der Verarbeitung: 0.3 Sekunden  (vorverarbeitet)  ]