You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For futures there is a convenient poll! macro that allows polling a future once inside of an async context. I couldn't find an equivalent for the poll_next method of streams. This would be really useful in my opinion.
Thanks for the tip. I initially thought this would be problematic in the Poll::Pending case, but since stream.next() only takes a mutable reference, this problem doesn't exist.
This would make the implementation of a poll_next! macro much easier as it would only need to wrap poll!(stream.next()).
In case a decision is made against the inclusion of poll_next!(..), the documentation of poll!(...) could at least be updated to mention this pattern.
For futures there is a convenient
poll!
macro that allows polling a future once inside of an async context. I couldn't find an equivalent for thepoll_next
method of streams. This would be really useful in my opinion.This could be done somewhat like this:
The text was updated successfully, but these errors were encountered: