async_std/stream/stream/
next.rs1use core::pin::Pin;
2use core::future::Future;
3
4use crate::stream::Stream;
5use crate::task::{Context, Poll};
6
7#[doc(hidden)]
8#[allow(missing_debug_implementations)]
9pub struct NextFuture<'a, T: Unpin + ?Sized> {
10 pub(crate) stream: &'a mut T,
11}
12
13impl<T: Stream + Unpin + ?Sized> Future for NextFuture<'_, T> {
14 type Output = Option<T::Item>;
15
16 fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
17 Pin::new(&mut *self.stream).poll_next(cx)
18 }
19}