Skip to content

Tracking Issue for Future::poll_once. #92115

Closed
@ibraheemdev

Description

@ibraheemdev

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions