Closed
Description
Feature gate: #![feature(poll_once)]
This is a tracking issue for Future::poll_once
, which returns the output of polling a future once.
let f = ready(1);
assert_eq!(f.poll_once().await, Poll::Ready(1));
let mut f = pending();
assert_eq!(f.poll_once().await, Poll::Pending);
Public API
trait Future {
// ...
fn poll_once(self) -> PollOnce<Self>
where
Self: Sized;
}
pub struct PollOnce<F> {
// ...
}
impl<F> Future for PollOnce<F>
where
F: Future + Unpin,
{
type Output = Poll<F::Output>;
// ...
}
Steps / History
- Implementation: Add
Future::poll_once
#92116 - Final comment period (FCP)
- Stabilization PR
Unresolved Questions
- None yet.