We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'd like to run FuturesOrdered::from_iter(...) and retrieve the result of the last element, which is Option<...>. The same function exists in std.
FuturesOrdered::from_iter(...)
Option<...>
It can be implemented with
iter.fold(None, |_acc, x| async move { Some(x) })
But try_last would require extra checks: if there is an intermediate error, return it. If not, return the last successful Ok(...).
try_last
Ok(...)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'd like to run
FuturesOrdered::from_iter(...)
and retrieve the result of the last element, which isOption<...>
. The same function exists in std.It can be implemented with
But
try_last
would require extra checks: if there is an intermediate error, return it. If not, return the last successfulOk(...)
.The text was updated successfully, but these errors were encountered: