Files
rust/src/libcore
Manish Goregaokar d82588b45a Rollup merge of #72303 - yoshuawuyts:future-poll-fn, r=dtolnay
Add core::future::{poll_fn, PollFn}

This is a sibling PR to #70834, adding `future::poll_fn`. This is a small helper function that helps bridge the gap between "poll state machines" and "async/await". It was first introduced in [futures@0.1.7](https://docs.rs/futures/0.1.7/futures/future/fn.poll_fn.html) in December of 2016, and has been tried and tested as part of the ecosystem for the past 3.5 years.

## Implementation

Much of the same reasoning from #70834 applies: by returning a concrete struct rather than an `async fn` we get to mark the future as `Unpin`. It also becomes named which allows storing it in structs without boxing. This implementation has been modified from the implementation in `futures-rs`.

## References
- [`futures::future::poll_fn`](https://docs.rs/futures/0.3.5/futures/future/fn.poll_fn.html)
- [`async_std::future::poll_fn`](https://docs.rs/async-std/1.5.0/async_std/future/fn.poll_fn.html)
2020-07-10 23:26:24 -07:00
..
2020-07-05 15:23:42 +08:00
2020-06-24 19:08:11 -04:00
2020-04-25 09:25:33 -04:00
2020-06-30 19:28:51 +02:00
2020-06-30 19:28:51 +02:00
2020-05-12 16:54:29 +01:00
2019-11-26 23:02:11 -08:00
2019-12-22 17:42:47 -05:00
2020-06-18 09:11:15 -07:00
2020-06-30 19:28:51 +02:00
2020-04-25 09:25:33 -04:00
2020-06-12 23:52:52 +02:00
2020-06-30 19:28:51 +02:00
2020-07-03 17:21:20 +02:00
2020-06-25 23:08:58 +01:00
2020-06-30 22:22:32 -07:00
2020-06-30 19:28:51 +02:00
2020-02-23 23:59:39 -08:00
2020-06-20 12:27:16 -07:00
2020-06-20 10:55:39 -04:00
2019-11-26 23:02:11 -08:00
2019-11-26 23:02:11 -08:00