Youâd need to .await a future in ablock that actually does some asynchronous work, or thatâs manually implemented to be able to return pending. With async blocks alone, you wonât encounter pending futures.
You can actually read the implementation of that function@alice mentioned to see how a simple manual implementation of a (sensible) Future that can return pending (without doing work / interacting with a runtime) looks like.
One could question the practical utility of a future that keeps pending indefinitely, but â sure â thatâs also an example of a Future that can return Pending.
Note that a smart executor won't poll a future again until it's been told to, so you might need to do an immediate cx.waker().wake_by_ref() when returning Poll::Pending otherwise MyFuture will never complete.