pub trait FuturePollingExt: Future { // Provided method fn polling(self) -> Polling<Self> ⓘ where Self: Sized { ... } }
Extension trait to easily convert a Future into a Polling.
Future
Polling
Returns [Polling::Pending(self)], consuming self.
Polling::Pending(self)
self
use core::task::Poll; use futures_polling::FuturePollingExt; let mut polling = async { 42 }.polling(); assert_eq!(polling.poll_once().await, Poll::Ready(42));