async-std v1.3.0 Release Notes

Release Date: 2019-12-12 // over 4 years ago
  • ๐Ÿ“š API Documentation

    This patch introduces Stream::delay, more methods on DoubleEndedStream, and improves compile times. Stream::delay is a new API that's similar to ๐Ÿ“„ task::sleep, but can be passed as part of as stream, rather than as a separate block. This is ๐Ÿ‘‰ useful for examples, or when manually debugging race conditions.

    Examples

    let start = Instant::now();
    let mut s = stream::from_iter(vec![0u8, 1]).delay(Duration::from_millis(200));
    
    // The first time will take more than 200ms due to delay.
    s.next().await;
    assert!(start.elapsed().as_millis() >= 200);
    
    // There will be no delay after the first time.
    s.next().await;
    assert!(start.elapsed().as_millis() <= 210);
    

    โž• Added

    • โž• Added Stream::delay as "unstable" (#309)
    • โž• Added DoubleEndedStream::next_back as "unstable" (#562)
    • โž• Added DoubleEndedStream::nth_back as "unstable" (#562)
    • โž• Added DoubleEndedStream::rfind as "unstable" (#562)
    • โž• Added DoubleEndedStream::rfold as "unstable" (#562)
    • โž• Added DoubleEndedStream::try_rfold as "unstable" (#562)
    • stream::Once now implements DoubleEndedStream (#562)
    • stream::FromIter now implements DoubleEndedStream (#562)

    ๐Ÿ”„ Changed

    • โœ‚ Removed our dependency on async-macros, speeding up compilation (#610)

    ๐Ÿ›  Fixes

    • ๐Ÿ›  Fixed a link in the task docs (#598)
    • ๐Ÿ›  Fixed the UdpSocket::recv example (#603)
    • ๐Ÿ›  Fixed a link to task::block_on (#608)
    • ๐Ÿ›  Fixed an incorrect API mention in task::Builder (#612)
    • ๐Ÿ›  Fixed leftover mentions of futures-preview (#595)
    • ๐Ÿ›  Fixed a typo in the tutorial (#614)
    • <TcpStream as Write>::poll_close now closes the write half of the stream (#618)