pub fn poll_immediate<S: Stream>(s: S) -> PollImmediate<S> {
    super::assert_stream::<Poll<S::Item>, PollImmediate<S>>(PollImmediate { stream: Some(s) })
}
Creates a new stream that always immediately returns [Poll::Ready](core::task::Poll::Ready) when awaiting it.

This is useful when immediacy is more important than waiting for the next item to be ready.

# Examples

```
# futures::executor::block_on(async {
use futures::stream::{self, StreamExt};
use futures::task::Poll;

let mut r = stream::poll_immediate(Box::pin(stream::iter(1_u32..3)));
assert_eq!(r.next().await, Some(Poll::Ready(1)));
assert_eq!(r.next().await, Some(Poll::Ready(2)));
assert_eq!(r.next().await, None);

let mut p = stream::poll_immediate(Box::pin(stream::once(async {
futures::pending!();
42_u8
})));
assert_eq!(p.next().await, Some(Poll::Pending));
assert_eq!(p.next().await, Some(Poll::Ready(42)));
assert_eq!(p.next().await, None);
# });
```
futures-util/src/stream/poll_immediate.rs