Stay up to date on releases
Create your free account today to subscribe to this repository for notifications about new releases, and build software alongside 40 million developers on GitHub.
Sign up for free See pricing for teams and enterprises
yoshuawuyts
released this
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::delayas "unstable" (#309) - Added
DoubleEndedStream::next_backas "unstable" (#562) - Added
DoubleEndedStream::nth_backas "unstable" (#562) - Added
DoubleEndedStream::rfindas "unstable" (#562) - Added
DoubleEndedStream::rfoldas "unstable" (#562) - Added
DoubleEndedStream::try_rfoldas "unstable" (#562) stream::Oncenow implementsDoubleEndedStream(#562)stream::FromIternow implementsDoubleEndedStream(#562)
Changed
- Removed our dependency on
async-macros, speeding up compilation (#610)
Fixes
- Fixed a link in the task docs (#598)
- Fixed the
UdpSocket::recvexample (#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_closenow closes the write half of the stream (#618)