Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking Issue for Future::poll_once. #92115

Closed
3 tasks
ibraheemdev opened this issue Dec 20, 2021 · 0 comments
Closed
3 tasks

Tracking Issue for Future::poll_once. #92115

ibraheemdev opened this issue Dec 20, 2021 · 0 comments
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@ibraheemdev
Copy link
Member

ibraheemdev commented Dec 20, 2021

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

Unresolved Questions

  • None yet.
@ibraheemdev ibraheemdev added C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Dec 20, 2021
@ibraheemdev ibraheemdev changed the title Tracking Issue for future::poll_once. Tracking Issue for Future::poll_once. Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

1 participant