futures_util/future/
empty.rs1use core::marker;
4
5use futures_core::{Future, Poll, Async};
6use futures_core::task;
7
8#[derive(Debug)]
12#[must_use = "futures do nothing unless polled"]
13pub struct Empty<T, E> {
14 _data: marker::PhantomData<(T, E)>,
15}
16
17pub fn empty<T, E>() -> Empty<T, E> {
22 Empty { _data: marker::PhantomData }
23}
24
25impl<T, E> Future for Empty<T, E> {
26 type Item = T;
27 type Error = E;
28
29 fn poll(&mut self, _: &mut task::Context) -> Poll<T, E> {
30 Ok(Async::Pending)
31 }
32}