Skip to content

Tracking Issue for Future::poll_once. #92115

New issue

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

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

Already on GitHub? # to your account

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: An issue tracking the progress of sth. like the implementation of an RFC 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: An issue tracking the progress of sth. like the implementation of an RFC 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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC 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