Function poll_fn
fn poll_fn<T, F>(f: F) -> PollFn<F>
where
F: FnMut(&mut Context<'_>) -> Poll<Option<T>>
Creates a new stream wrapping a function returning Poll<Option<T>>.
Polling the returned stream calls the wrapped function.
Examples
use poll_fn;
use Poll;
let mut counter = 1usize;
let read_stream = poll_fn;