.poll(&cx) vs .await?

Hello :slight_smile:
Intermediate Rustacean now.

Does anyone know how to call the poll method on a generic type that impls Future?

seems like future.await does it for you but.. if you want to write your own stream or future you cant call .await in the poll/poll_next method because traits don't support Impl Trait yet.

To propegate Poll:Pending or Poll::Ready... I need to call poll. :confused:

It seems that you'll likely poll one future from another, so you could try to simply pass the context from the parent poll.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.