pub fn poll_immediate<F: Future>(f: F) -> PollImmediate<F> {
    assert_future::<Option<F::Output>, PollImmediate<F>>(PollImmediate { future: Some(f) })
}
Creates a future that is immediately ready with an Option of a value.
Specifically this means that [poll](core::future::Future::poll()) always returns [Poll::Ready](core::task::Poll::Ready).

# Caution

When consuming the future by this function, note the following:

- This function does not guarantee that the future will run to completion, so it is generally incompatible with passing the non-cancellation-safe future by value.
- Even if the future is cancellation-safe, creating and dropping new futures frequently may lead to performance problems.

# Examples

```
# futures::executor::block_on(async {
use futures::future;

let r = future::poll_immediate(async { 1_u32 });
assert_eq!(r.await, Some(1));

let p = future::poll_immediate(future::pending::<i32>());
assert_eq!(p.await, None);
# });
```

### Reusing a future

```
# futures::executor::block_on(async {
use core::pin::pin;

use futures::future;

let f = async {futures::pending!(); 42_u8};
let mut f = pin!(f);
assert_eq!(None, future::poll_immediate(&mut f).await);
assert_eq!(42, f.await);
# });
```
futures-util/src/future/poll_immediate.rs