Skip to main content

FuturePollingExt

Trait FuturePollingExt 

Source
pub trait FuturePollingExt: Future {
    // Provided method
    fn polling(self) -> Polling<Self> 
       where Self: Sized { ... }
}
Expand description

Extension trait to easily convert a Future into a Polling.

Provided Methods§

Source

fn polling(self) -> Polling<Self>
where Self: Sized,

Returns [Polling::Pending(self)], consuming self.

§Example
use core::task::Poll;
use futures_polling::FuturePollingExt;

let mut polling = async { 42 }.polling();
assert_eq!(polling.poll_once().await, Poll::Ready(42));

Implementors§

Source§

impl<Fut: Future> FuturePollingExt for Fut