diff options
author | Carl Lerche <me@carllerche.com> | 2019-06-24 12:34:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-24 12:34:30 -0700 |
commit | 06c473e62842d257ed275497ce906710ea3f8e19 (patch) | |
tree | 4ca6d337a892aa23266a761b35dc61e988e57954 /tokio-futures/src/stream/mod.rs | |
parent | aa99950b9c983b842bd2107bb771c277d09d495d (diff) |
Update Tokio to use `std::future`. (#1120)
A first pass at updating Tokio to use `std::future`.
Implementations of `Future` from the futures crate are updated to implement
`Future` from std. Implementations of `Stream` are moved to a feature flag.
This commits disables a number of crates that have not yet been updated.
Diffstat (limited to 'tokio-futures/src/stream/mod.rs')
-rw-r--r-- | tokio-futures/src/stream/mod.rs | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/tokio-futures/src/stream/mod.rs b/tokio-futures/src/stream/mod.rs deleted file mode 100644 index a6d987d6..00000000 --- a/tokio-futures/src/stream/mod.rs +++ /dev/null @@ -1,38 +0,0 @@ -//! Use streams with `async` / `await`. - -mod next; - -pub use self::next::Next; - -use futures::Stream; - -/// An extension trait which adds utility methods to `Stream` types. -pub trait StreamExt: Stream { - /// Creates a future that resolves to the next item in the stream. - /// - /// # Examples - /// - /// ```edition2018 - /// #![feature(async_await)] - /// tokio::run_async(async { - /// // The extension trait can also be imported with - /// // `use tokio::prelude::*`. - /// use tokio::prelude::{stream, StreamAsyncExt}; - /// - /// let mut stream = stream::iter_ok::<_, ()>(1..3); - /// - /// assert_eq!(stream.next().await, Some(Ok(1))); - /// assert_eq!(stream.next().await, Some(Ok(2))); - /// assert_eq!(stream.next().await, Some(Ok(3))); - /// assert_eq!(stream.next().await, None); - /// }); - /// ``` - fn next(&mut self) -> Next<'_, Self> - where - Self: Sized + Unpin, - { - Next::new(self) - } -} - -impl<T: Stream> StreamExt for T {} |