2
0
Fork 1
mirror of https://github.com/async-rs/async-std.git synced 2025-06-20 21:21:34 +00:00
async-std/src/stream/double_ended_stream/next_back.rs
2020-01-28 15:58:46 +09:00

19 lines
525 B
Rust

use core::pin::Pin;
use core::future::Future;
use crate::stream::DoubleEndedStream;
use crate::task::{Context, Poll};
#[doc(hidden)]
#[allow(missing_debug_implementations)]
pub struct NextBackFuture<'a, T: Unpin + ?Sized> {
pub(crate) stream: &'a mut T,
}
impl<T: DoubleEndedStream + Unpin + ?Sized> Future for NextBackFuture<'_, T> {
type Output = Option<T::Item>;
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
Pin::new(&mut *self.stream).poll_next_back(cx)
}
}